configure.ac: always define __STDC_CONSTANT_MACROS
authorOded Gabbay <oded.gabbay@gmail.com>
Mon, 11 Jan 2016 19:55:15 +0000 (21:55 +0200)
committerOded Gabbay <oded.gabbay@gmail.com>
Mon, 11 Jan 2016 21:28:23 +0000 (23:28 +0200)
The ISO C99 standard (7.18.4) specifies that C++
implementations should define UINT64_C only when
__STDC_CONSTANT_MACROS is defined.

Because we now use UINT64_C in our cpp files (since commit
208bfc493debe0344d0b9cb93975981f14412628), we need to add this define.

This also solves compilation errors with GCC 4.8.x on ppc64le machines.

v2: add this define to SCons build system

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
configure.ac
scons/gallium.py

index 9c3d1a3481e9b144c69fe10406e88429dd2723cb..8d19dabcb77750e73cd08749e10d17df0b2e0816 100644 (file)
@@ -245,7 +245,7 @@ _SAVE_LDFLAGS="$LDFLAGS"
 _SAVE_CPPFLAGS="$CPPFLAGS"
 
 dnl Compiler macros
-DEFINES="-D__STDC_LIMIT_MACROS"
+DEFINES="-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
 AC_SUBST([DEFINES])
 case "$host_os" in
 linux*|*-gnu*|gnu*)
index 46dbf0ebd0e58e71f131c72ba04ca522d7c3cc54..6dcd95233c3bedb9b93931298d84b79474cd631f 100755 (executable)
@@ -300,7 +300,7 @@ def generate(env):
 
     # C preprocessor options
     cppdefines = []
-    cppdefines += ['__STDC_LIMIT_MACROS']
+    cppdefines += ['__STDC_LIMIT_MACROS', '__STDC_CONSTANT_MACROS']
     if env['build'] in ('debug', 'checked'):
         cppdefines += ['DEBUG']
     else: