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 <feste...@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

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to