From: Matthias Clasen Date: Sat, 18 Feb 2023 14:34:50 +0000 (-0500) Subject: securememory: use function checks X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~6^2~63^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=19c362f638e383417ecf08b8f3bf1d581e69abb4;p=gtk4.git securememory: use function checks Checking for getpagesize in meson.build is useless if we don't check the resulting define in the code. So do that. --- diff --git a/gtk/gtksecurememory.c b/gtk/gtksecurememory.c index a83f57d961..f5c43c4068 100644 --- a/gtk/gtksecurememory.c +++ b/gtk/gtksecurememory.c @@ -35,7 +35,7 @@ #include -#if defined(HAVE_MLOCK) +#if defined(HAVE_SYS_MMAN_H) #include #endif @@ -229,7 +229,7 @@ pool_alloc (void) return NULL; } -#ifdef HAVE_MMAP +#if defined(HAVE_MMAP) && defined(HAVE_GETPAGESIZE) /* A pool with an available item */ Pool *pool = NULL; @@ -916,7 +916,7 @@ sec_acquire_pages (size_t *sz, g_assert (*sz); g_assert (during_tag); -#if defined(HAVE_MLOCK) && defined(HAVE_MMAP) +#if defined(HAVE_MLOCK) && defined(HAVE_MMAP) && defined(HAVE_GETPAGESIZE) /* Make sure sz is a multiple of the page size */ unsigned long pgsize = getpagesize (); @@ -1000,7 +1000,7 @@ sec_release_pages (void *pages, size_t sz) { g_assert (pages); -#if defined(HAVE_MLOCK) +#if defined(HAVE_MLOCK) && defined(HAVE_GETPAGESIZE) g_assert (sz % getpagesize () == 0); if (munlock (pages, sz) < 0 && gtk_secure_warnings)