util: Define strchrnul on macOS.
authorVinson Lee <vlee@freedesktop.org>
Fri, 30 Aug 2019 06:56:17 +0000 (23:56 -0700)
committerVinson Lee <vlee@freedesktop.org>
Sat, 31 Aug 2019 20:26:10 +0000 (13:26 -0700)
strchrnul is not available on macOS.

pipe_loader.c:141:14: error: implicit declaration of function 'strchrnul' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      next = strchrnul(library_paths, ':');
             ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
src/util/u_string.h

index 361dcb41e2bec42abee2c36138a8aca439830306..cd21f9d1af1b0dbffece986054a444498502978f 100644 (file)
@@ -50,7 +50,7 @@
 extern "C" {
 #endif
 
-#ifndef _GNU_SOURCE
+#if !defined(_GNU_SOURCE) || defined(__APPLE__)
 
 #define strchrnul util_strchrnul
 static inline char *