diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-02-16 19:36:51 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-02-16 19:36:51 +0000 |
commit | bd57369de85d0249cdc3e21102d5197c6dbb646a (patch) | |
tree | 36f961f336183ba1e06ec6b05e09266b4fdcec8e /src | |
parent | 4f038aab87c99e34322e7cff82757bfd6c1a4b93 (diff) | |
download | hercules-bd57369de85d0249cdc3e21102d5197c6dbb646a.tar.gz hercules-bd57369de85d0249cdc3e21102d5197c6dbb646a.tar.bz2 hercules-bd57369de85d0249cdc3e21102d5197c6dbb646a.tar.xz hercules-bd57369de85d0249cdc3e21102d5197c6dbb646a.zip |
* Updated configure/make scripts to resolve various issues.
- Added detection whether or not -fPIC switch is required when compiling shared objects (plug-ins) to resolve compile issues on 64-bit platforms (topic:208746).
- Native 'strnlen' implementations are now detected and disable the one in strlib (bugreport:1261).
- Define 'DB_MANUAL_CAST_TO_UNION' is now set when necessary (bugreport:1261).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14708 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/common/strlib.c | 3 | ||||
-rw-r--r-- | src/common/strlib.h | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/common/strlib.c b/src/common/strlib.c index a0cba906c..66f281ffc 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -8,7 +8,6 @@ #include <stdio.h> #include <stdlib.h> -#include <string.h> #include <errno.h> @@ -241,7 +240,7 @@ char* _strtok_r(char *s1, const char *s2, char **lasts) } #endif -#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) && !defined(CYGWIN) +#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) && !defined(HAVE_STRNLEN) /* Find the length of STRING, but scan at most MAXLEN characters. If no '\0' terminator is found in that many characters, return MAXLEN. */ size_t strnlen (const char* string, size_t maxlen) diff --git a/src/common/strlib.h b/src/common/strlib.h index 23f1e191a..3f4f984cf 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -9,6 +9,10 @@ #endif #include <stdarg.h> +#define __USE_GNU // required to enable strnlen on some platforms +#include <string.h> +#undef __USE_GNU + char* jstrescape (char* pt); char* jstrescapecpy (char* pt, const char* spt); int jmemescapecpy (char* pt, const char* spt, int size); @@ -24,7 +28,7 @@ const char *stristr(const char *haystack, const char *needle); char* _strtok_r(char* s1, const char* s2, char** lasts); #endif -#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) && !defined(CYGWIN) +#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) && !defined(HAVE_STRNLEN) size_t strnlen (const char* string, size_t maxlen); #endif |