ref: d83e084c259d8b6c47062fafebf97a4c1bfb7ef2
parent: dc371f98231b7bc0f0554624443f4fd144af574e
author: Marvin Scholz <[email protected]>
date: Sun Sep 23 16:26:52 EDT 2018
Build: Use POSIX.1–2001 (IEEE Std 1003.1-2001) Define `_POSIX_C_SOURCE` to `200112L`, to indicate we want to use POSIX.1–2001. Additionally remove incorrect definition of `POSIX_C_SOURCE` (note the lack of underscore at the beginning). The intention was probably to define `_POSIX_C_SOURCE` which would be redundant and previously even conflicting with the other version set previously. For the has_function check, use the correct value of `200112L`.
--- a/meson.build
+++ b/meson.build
@@ -56,7 +56,7 @@
feature_defines = [
['_GNU_SOURCE', 1], # Enable GNU extensions on systems that have them
- ['_POSIX_C_SOURCE', '200809L'], #IEEE Std 1003.1
+ ['_POSIX_C_SOURCE', '200112L'], # POSIX.1–2001 (IEEE Std 1003.1-2001)
]
if host_machine.system() == 'windows'
@@ -100,8 +100,7 @@
warning('Compiler does not support -fvisibility=hidden, all symbols will be public!')
endif
-if cc.has_function('posix_memalign', prefix: '#include <stdlib.h>', args: ['-D_POSIX_C_SOURCE=200112'])
- feature_defines += [['POSIX_C_SOURCE', 200112]]
+if cc.has_function('posix_memalign', prefix: '#include <stdlib.h>', args: ['-D_POSIX_C_SOURCE=200112L'])
cdata.set('HAVE_POSIX_MEMALIGN', 1)
elif cc.has_function('_aligned_malloc', prefix: '#include <malloc.h>')
cdata.set('HAVE_ALIGNED_MALLOC', 1)