Commit d83e084c authored by Marvin Scholz's avatar Marvin Scholz Committed by Jean-Baptiste Kempf

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`.
parent dc371f98
......@@ -56,7 +56,7 @@ endforeach
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 @@ else
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment