Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

Issue Confirmations

  • Yes (0)No (0)
Photo

Missing Strnlen

Posted by Hercules Bot on 03 September 2007 - 10:14 AM

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:
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...

This post has been edited by theultramage: Sep 3 2007, 03:37 AM