[vlc-devel] [PATCH] Fix build error if strnstr is missing

Bernd Kuhls bernd.kuhls at t-online.de
Sat Apr 2 15:33:18 CEST 2016


Support for strnstr was added in
http://git.videolan.org/?p=vlc.git;a=commitdiff;h=4c1238c77239cdea38a44748f2800332818b6750

but for systems lacking it, it broke the build:

  CC       strnstr.lo
In file included from ../config.h:887:0,
                 from strnstr.c:22:
../include/vlc_fixups.h:157:45: error: unknown type name ‘size_t’
 char * strnstr (const char *, const char *, size_t);

This patch fixes the problem by adding strnstr to a list of other
functions to get size_t defined.

Bug was reported to trac:
https://trac.videolan.org/vlc/ticket/16767

Signed-off-by: Bernd Kuhls <bernd.kuhls at t-online.de>
---
 include/vlc_fixups.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index ce60430..95542a1 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -74,7 +74,8 @@ typedef struct
 #if !defined (HAVE_POSIX_MEMALIGN) || \
     !defined (HAVE_STRLCPY) || \
     !defined (HAVE_STRNDUP) || \
-    !defined (HAVE_STRNLEN)
+    !defined (HAVE_STRNLEN) || \
+    !defined (HAVE_STRNSTR)
 # include <stddef.h> /* size_t */
 #endif
 
-- 
2.8.0.rc3



More information about the vlc-devel mailing list