Skip to content

Commit 8a9a719

Browse files
akihikodakiMichael Tokarev
authored andcommitted
meson: Use osdep_prefix for strchrnul()
macOS SDK may have the symbol of strchrnul(), but it is actually available only on macOS 15.4 or later and that fact is codified in string.h. Include the header file using osdep_prefix to check if the function is available on the deployment target. Cc: [email protected] Signed-off-by: Akihiko Odaki <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Philippe Mathieu-Daudé <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> (cherry picked from commit a5b30be) Signed-off-by: Michael Tokarev <[email protected]>
1 parent e1ccfea commit 8a9a719

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2193,6 +2193,7 @@ osdep_prefix = '''
21932193
#include <stddef.h>
21942194
#include <sys/types.h>
21952195
2196+
#include <string.h>
21962197
#include <limits.h>
21972198
/* Put unistd.h before time.h as that triggers localtime_r/gmtime_r
21982199
* function availability on recentish Mingw-w64 platforms. */
@@ -2657,7 +2658,7 @@ config_host_data.set('HAVE_GETIFADDRS', cc.has_function('getifaddrs'))
26572658
config_host_data.set('HAVE_GLIB_WITH_SLICE_ALLOCATOR', glib_has_gslice)
26582659
config_host_data.set('HAVE_GLIB_WITH_ALIGNED_ALLOC', glib_has_aligned_alloc)
26592660
config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util))
2660-
config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul'))
2661+
config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul', prefix: osdep_prefix))
26612662
config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include <stdlib.h>'))
26622663
if rbd.found()
26632664
config_host_data.set('HAVE_RBD_NAMESPACE_EXISTS',

0 commit comments

Comments
 (0)