Provide strdup() compat

Make strdup() available on all platforms.
This commit is contained in:
Romain Vimont
2021-01-17 14:11:59 +01:00
parent 97b001e7c0
commit 2c8efe1a1d
3 changed files with 30 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ src = [
'src/main.c',
'src/adb.c',
'src/cli.c',
'src/compat.c',
'src/control_msg.c',
'src/controller.c',
'src/decoder.c',
@@ -31,6 +32,10 @@ else
src += [ 'src/sys/unix/process.c' ]
endif
check_functions = [
'strdup'
]
cc = meson.get_compiler('c')
if not get_option('crossbuild_windows')
@@ -86,6 +91,13 @@ endif
conf = configuration_data()
foreach f : check_functions
if cc.has_function(f)
define = 'HAVE_' + f.underscorify().to_upper()
conf.set(define, true)
endif
endforeach
# expose the build type
conf.set('NDEBUG', get_option('buildtype') != 'debug')