Changeset - r15230:2d72b40155e8
[Not reviewed]
master
0 2 0
rubidium - 14 years ago 2010-05-21 15:56:19
rubidium@openttd.org
(svn r19874) -Fix [FS#3845]: NetBSD compilation was still broken in some cases (Krille)
2 files changed with 7 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/string.cpp
Show inline comments
 
@@ -398,7 +398,7 @@ size_t Utf8TrimString(char *s, size_t ma
 
	return length;
 
}
 

	
 
#ifndef _GNU_SOURCE
 
#ifdef DEFINE_STRNDUP
 
#include "core/math_func.hpp"
 
char *strndup(const char *s, size_t len)
 
{
 
@@ -407,7 +407,7 @@ char *strndup(const char *s, size_t len)
 
	memcpy(tmp, s, len);
 
	return tmp;
 
}
 
#endif /* !_GNU_SOURCE */
 
#endif /* DEFINE_STRNDUP */
 

	
 
#ifdef DEFINE_STRCASESTR
 
char *strcasestr(const char *haystack, const char *needle)
src/string_func.h
Show inline comments
 
@@ -251,10 +251,13 @@ static inline bool IsWhitespace(WChar c)
 
#include <sys/param.h>
 
#endif
 

	
 
#if !defined(_GNU_SOURCE) && !(defined(__NetBSD_Version__) && 400000000 < __NetBSD_Version__ )
 
/* strndup is a GNU extension */
 
#if defined(_GNU_SOURCE) || (defined(__NetBSD_Version__) && 400000000 <= __NetBSD_Version__)
 
#	undef DEFINE_STRNDUP
 
#else
 
#	define DEFINE_STRNDUP
 
char *strndup(const char *s, size_t len);
 
#endif /* !_GNU_SOURCE */
 
#endif /* strndup is available */
 

	
 
/* strcasestr is available for _GNU_SOURCE, BSD and some Apple */
 
#if defined(_GNU_SOURCE) || (defined(__BSD_VISIBLE) && __BSD_VISIBLE) || (defined(__APPLE__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))) || defined(_NETBSD_SOURCE)
0 comments (0 inline, 0 general)