Gerald Pfeifer : loader: Unbreak FreeBSD builds (ARRAY_SIZE undefined).
Module: wine Branch: master Commit: 699067ae145952ff118a19e7ac4c45b71bfc38da URL: https://gitlab.winehq.org/wine/wine/-/commit/699067ae145952ff118a19e7ac4c45b... Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Fri Oct 28 01:02:44 2022 +0200 loader: Unbreak FreeBSD builds (ARRAY_SIZE undefined). Commit af996344a815baa1278d32181ddfda5e889a16d9 used ARRAY_SIZE in FreeBSD-specifc code which, alas, is not available here, so revert that change. --- loader/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/main.c b/loader/main.c index 36e1f5f0967..242ff15accd 100644 --- a/loader/main.c +++ b/loader/main.c @@ -90,7 +90,7 @@ static const char *get_self_exe( char *argv0 ) static int pathname[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; size_t path_size = PATH_MAX; char *path = malloc( path_size ); - if (path && !sysctl( pathname, ARRAY_SIZE( pathname ), path, &path_size, NULL, 0 )) + if (path && !sysctl( pathname, sizeof(pathname)/sizeof(pathname[0]), path, &path_size, NULL, 0 )) return path; free( path ); #endif
participants (1)
-
Alexandre Julliard