[Mesa-dev] [PATCH] vma/tests: Fix compilation if limits.h defines PAGE_SIZE

Eric Engestrom eric.engestrom at intel.com
Thu Jul 5 15:13:23 UTC 2018


On Thursday, 2018-07-05 15:52:01 +0100, Jon Turney wrote:
> per POSIX, limits.h may define PAGE_SIZE when the value is not indeterminate

"may define" -> don't you need #ifdef around #undef?

> 
> Cc: Scott D Phillips <scott.d.phillips at intel.com>
> Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
> ---
>  src/util/tests/vma/vma_random_test.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/util/tests/vma/vma_random_test.cpp b/src/util/tests/vma/vma_random_test.cpp
> index de887fead3..c08f3751a4 100644
> --- a/src/util/tests/vma/vma_random_test.cpp
> +++ b/src/util/tests/vma/vma_random_test.cpp
> @@ -40,6 +40,7 @@
>  
>  namespace {
>  
> +#undef PAGE_SIZE
>  static const uint64_t PAGE_SIZE = 4096;
>  
>  struct allocation {
> -- 
> 2.17.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list