mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
util: Add os_get_page_size support for macOS.
Fix build error on macOS.
src/util/os_misc.c:352:2: error: unexpected platform in os_sysinfo.c
error unexpected platform in os_sysinfo.c
^
Fixes: ("cdf3a6a83b50 util: Add os_get_page_size query")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7911>
This commit is contained in:
parent
ba42de95da
commit
da16425690
1 changed files with 7 additions and 0 deletions
|
|
@ -348,6 +348,13 @@ os_get_page_size(uint64_t *size)
|
|||
GetSystemInfo(&SysInfo);
|
||||
*size = SysInfo.dwPageSize;
|
||||
return true;
|
||||
#elif DETECT_OS_APPLE
|
||||
size_t len = sizeof(*size);
|
||||
int mib[2];
|
||||
|
||||
mib[0] = CTL_HW;
|
||||
mib[1] = HW_PAGESIZE;
|
||||
return (sysctl(mib, 2, size, &len, NULL, 0) == 0);
|
||||
#else
|
||||
#error unexpected platform in os_sysinfo.c
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue