Issue Information
-
#000007
-
5 - Critical
-
Fixed
Issue Confirmations
-
Yes (0)No (0)
Originally posted by theultramage
http://www.eathena.w...acker&showbug=7
Short summary:
EAPP latest will only compile on Visual Studio. On freebsd and mingw at least, the compilation will fail due to a missing 'strnlen' implementation.
Details:
The Single UNIX Specification doesn't specify 'strnlen'. I hear it's a GNU extension (plus microsoft added it lately).
For example, mingw and freebsd don't implement it (although it can be implemented as a two-liner that utilizes one standard function).
Anyways - I implemented it like this:
In eapp, it was implemented like this:
Both are somewhat wrong. Mine will cause a collision on linux, eapp's will only compile on windows and systems that actually implement strnlen.
I noticed that the configure script already checks for strnlen. So either adding it to the condition, or doing
This post has been edited by theultramage: Sep 3 2007, 03:37 AM
http://www.eathena.w...acker&showbug=7
Short summary:
EAPP latest will only compile on Visual Studio. On freebsd and mingw at least, the compilation will fail due to a missing 'strnlen' implementation.
Details:
The Single UNIX Specification doesn't specify 'strnlen'. I hear it's a GNU extension (plus microsoft added it lately).
For example, mingw and freebsd don't implement it (although it can be implemented as a two-liner that utilizes one standard function).
Anyways - I implemented it like this:
CODE
#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) // for older VS and non-windows systems
In eapp, it was implemented like this:
CODE
#if defined(_MSC_VER) && _MSC_VER < 1400 // for older VS
Both are somewhat wrong. Mine will cause a collision on linux, eapp's will only compile on windows and systems that actually implement strnlen.
I noticed that the configure script already checks for strnlen. So either adding it to the condition, or doing
CODE
#if defined(_MSC_VER) && _MSC_VER >= 1400
#define HAVE_STRNLEN
#endif
...
#ifdef HAVE_STRNLEN
<strnlen code>
#endif
should do the trick...#define HAVE_STRNLEN
#endif
...
#ifdef HAVE_STRNLEN
<strnlen code>
#endif
This post has been edited by theultramage: Sep 3 2007, 03:37 AM