[gcr/wip/nielsdg/fix-warnings: 1/3] meson: Add missing feature test macro's



commit 473c3901c9fd67d429901faebbb8157de292d7f8
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sat Jan 11 07:16:42 2020 +0100

    meson: Add missing feature test macro's
    
    We needed this for the call to `strptime()` and `timegm()`.
    
    Also once we missed a `#include <time.h>`

 gck/gck-slot.c  | 1 +
 gck/meson.build | 2 ++
 gcr/meson.build | 1 +
 3 files changed, 4 insertions(+)
---
diff --git a/gck/gck-slot.c b/gck/gck-slot.c
index 21f9f9b..f3b2f97 100644
--- a/gck/gck-slot.c
+++ b/gck/gck-slot.c
@@ -28,6 +28,7 @@
 #include "egg/egg-timegm.h"
 
 #include <string.h>
+#include <time.h>
 
 /**
  * SECTION:gck-slot
diff --git a/gck/meson.build b/gck/meson.build
index e91ad5f..756b486 100644
--- a/gck/meson.build
+++ b/gck/meson.build
@@ -77,6 +77,8 @@ gck_cflags = [
   '-DGCK_API_SUBJECT_TO_CHANGE',
   '-DP11_KIT_API_SUBJECT_TO_CHANGE',
   '-DPKCS11_REGISTRY_DIR="@0@"'.format(get_option('prefix') / get_option('libdir') / 'pkcs11'),
+  '-D_XOPEN_SOURCE',   # Needed for strptime()
+  '-D_DEFAULT_SOURCE', # Needed for timegm
 ]
 
 gck_symbolmap = meson.current_source_dir() / 'libgck.map'
diff --git a/gcr/meson.build b/gcr/meson.build
index 77f361a..3f37b8b 100644
--- a/gcr/meson.build
+++ b/gcr/meson.build
@@ -146,6 +146,7 @@ gcr_base_cflags = [
   '-DGCR_API_SUBJECT_TO_CHANGE',
   '-DGCK_API_SUBJECT_TO_CHANGE',
   '-DP11_KIT_API_SUBJECT_TO_CHANGE',
+  '-D_XOPEN_SOURCE',   # Needed for strptime()
 ]
 
 gcr_base_symbolmap = meson.current_source_dir() / 'libgcr-base.map'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]