[Mesa-dev] [PATCH kmscube v2] meson.build: Change c_std to gnu99

Fabio Estevam festevam at gmail.com
Tue Mar 31 00:52:59 UTC 2020


Since commit 301a556b8ece ("add fps reporting") the <time.h> header
is included, which causes build failures with c99 extension on ARM32:

../common.c: In function 'get_time_ns':
../common.c:376:18: error: storage size of 'tv' isn't known
  struct timespec tv;
                  ^~
../common.c:377:16: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
  clock_gettime(CLOCK_MONOTONIC, &tv);

Change c_std to gnu99 to fix the build error as explained at:
https://gcc-help.gcc.gnu.narkive.com/8xCaKI6r/problem-with-struct-timespec-and-c99-standard
 
c99 has been used since commit 6cbd03ab9406 ("Makefile.am: Add -std=c99 to
CFLAGS") to fix the following mips64el build failure:

"cube-tex.c:230:2: note: use option -std=c99 or -std=gnu99 to compile your code"

Use c_std=gnu99 to make both mips64el and ARM32 happy.

Signed-off-by: Fabio Estevam <festevam at gmail.com>
---
Changes since v1:
- Change c_std to gnu99

 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index b8131db..4fca2f2 100644
--- a/meson.build
+++ b/meson.build
@@ -26,11 +26,11 @@ project(
   version : '0.0.1',
   license : 'MIT',
   meson_version : '>= 0.47',
-  default_options : ['c_std=c99', 'warning_level=2']
+  default_options : ['c_std=gnu99', 'warning_level=2']
 )
 
-if get_option('c_std') != 'c99'
-  error('c_std must be c99')
+if get_option('c_std') != 'gnu99'
+  error('c_std must be gnu99')
 endif
 
 sources = files(
-- 
2.17.1



More information about the mesa-dev mailing list