Describe the bug
Cannot build StormLib dependency on FreeBSD 12 (amd64):
[ 54%] Linking CXX static library libdevilution.a
[ 54%] Built target devilution
Scanning dependencies of target StormLib
[ 55%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/FileStream.cpp.o
/tmp/devilutionX-master/3rdParty/StormLib/src/FileStream.cpp:597:9: error: use of undeclared identifier 'strncasecmp'
if(!_tcsnicmp(szFileName, _T("http://"), 7))
^
/tmp/devilutionX-master/3rdParty/StormLib/src/StormPort.h:248:21: note: expanded from macro '_tcsnicmp'
#define _tcsnicmp strncasecmp
^
/tmp/devilutionX-master/3rdParty/StormLib/src/FileStream.cpp:2470:13: error: use of undeclared identifier 'strncasecmp'
if(!_tcsnicmp(szFileName, _T("flat-"), 5))
^
/tmp/devilutionX-master/3rdParty/StormLib/src/StormPort.h:248:21: note: expanded from macro '_tcsnicmp'
#define _tcsnicmp strncasecmp
^
/tmp/devilutionX-master/3rdParty/StormLib/src/FileStream.cpp:2476:18: error: use of undeclared identifier 'strncasecmp'
else if(!_tcsnicmp(szFileName, _T("part-"), 5))
^
/tmp/devilutionX-master/3rdParty/StormLib/src/StormPort.h:248:21: note: expanded from macro '_tcsnicmp'
#define _tcsnicmp strncasecmp
^
/tmp/devilutionX-master/3rdParty/StormLib/src/FileStream.cpp:2482:18: error: use of undeclared identifier 'strncasecmp'
else if(!_tcsnicmp(szFileName, _T("mpqe-"), 5))
^
/tmp/devilutionX-master/3rdParty/StormLib/src/StormPort.h:248:21: note: expanded from macro '_tcsnicmp'
#define _tcsnicmp strncasecmp
^
/tmp/devilutionX-master/3rdParty/StormLib/src/FileStream.cpp:2488:18: error: use of undeclared identifier 'strncasecmp'
else if(!_tcsnicmp(szFileName, _T("blk4-"), 5))
^
/tmp/devilutionX-master/3rdParty/StormLib/src/StormPort.h:248:21: note: expanded from macro '_tcsnicmp'
#define _tcsnicmp strncasecmp
^
/tmp/devilutionX-master/3rdParty/StormLib/src/FileStream.cpp:2498:13: error: use of undeclared identifier 'strncasecmp'
if(!_tcsnicmp(szFileName+nPrefixLength1, _T("file:"), 5))
^
/tmp/devilutionX-master/3rdParty/StormLib/src/StormPort.h:248:21: note: expanded from macro '_tcsnicmp'
#define _tcsnicmp strncasecmp
^
/tmp/devilutionX-master/3rdParty/StormLib/src/FileStream.cpp:2504:18: error: use of undeclared identifier 'strncasecmp'
else if(!_tcsnicmp(szFileName+nPrefixLength1, _T("map:"), 4))
^
/tmp/devilutionX-master/3rdParty/StormLib/src/StormPort.h:248:21: note: expanded from macro '_tcsnicmp'
#define _tcsnicmp strncasecmp
^
/tmp/devilutionX-master/3rdParty/StormLib/src/FileStream.cpp:2510:18: error: use of undeclared identifier 'strncasecmp'
else if(!_tcsnicmp(szFileName+nPrefixLength1, _T("http:"), 5))
^
/tmp/devilutionX-master/3rdParty/StormLib/src/StormPort.h:248:21: note: expanded from macro '_tcsnicmp'
#define _tcsnicmp strncasecmp
^
8 errors generated.
To Reproduce
Build with:
$ cd build/
$ cmake ..
$ gmake
Probably needs the BSD <strings.h> header
Doesn鈥檛 help, but there is an official FreeBSD port already.
That sure depends on who you see as the official party :)
FreeBSD indeed has this function in <strings.h>:
https://www.freebsd.org/cgi/man.cgi?query=strcasecmp&sektion=3
However, StormLib doesn't have BSD platform support.
Looks like this was "fixed" upstream 7 hours ago by just always including <strings.h> on unknown platforms. Good enough.
https://github.com/ladislav-zezula/StormLib/commit/8c874cb586f59a444e2b8ee8a50aabb2986ffd42
merged
Most helpful comment
That sure depends on who you see as the official party :)