Devilutionx: Cannot build StormLib on FreeBSD (undeclared identifier)

Created on 21 Oct 2019  路  5Comments  路  Source: diasurgical/devilutionX

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

Most helpful comment

That sure depends on who you see as the official party :)

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

predator8bit picture predator8bit  路  4Comments

julealgon picture julealgon  路  4Comments

Askmewho picture Askmewho  路  5Comments

AJenbo picture AJenbo  路  4Comments

legluondunet picture legluondunet  路  5Comments