[Mesa-dev] [PATCH kmscube] meson.build: Do not set c_std

Fabio Estevam festevam at gmail.com
Mon Mar 30 21:29:37 UTC 2020


When building kmscube in Buildroot for ARM the following
errors are seen:

../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:2: warning: implicit declaration of function 'clock_gettime'; did you mean 'localtime'? [-Wimplicit-function-declaration]
  clock_gettime(CLOCK_MONOTONIC, &tv);
  ^~~~~~~~~~~~~
  localtime
../common.c:377:16: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
  clock_gettime(CLOCK_MONOTONIC, &tv);

Fix it by using the default for each compiler on every platform instead.

Inspired by this gst-plugins-good commit:

https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=19f6559582c73123a3ec1fcf5a6b8651fbc2e83f

Signed-off-by: Fabio Estevam <festevam at gmail.com>
---
 meson.build | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index b8131db..0f52dfe 100644
--- a/meson.build
+++ b/meson.build
@@ -26,13 +26,9 @@ project(
   version : '0.0.1',
   license : 'MIT',
   meson_version : '>= 0.47',
-  default_options : ['c_std=c99', 'warning_level=2']
+  default_options : ['warning_level=2']
 )
 
-if get_option('c_std') != 'c99'
-  error('c_std must be c99')
-endif
-
 sources = files(
   'common.c',
   'cube-shadertoy.c',
-- 
2.17.1



More information about the mesa-dev mailing list