Created attachment 47028 [details] fix kfreebsd ftbfs While building Qt 4.6.1 on GNU/kFreeBSD, it fails to build from scratch: websockets/WebSocketHandshake.cpp: In member function ‘int WebCore::WebSocketHandshake::readServerHandshake(const char*, size_t)’: websockets/WebSocketHandshake.cpp:255: error: ‘strnstr’ was not declared in this scope it's caused by the missing strnstr() function on glibc systems. webkit trunk should be also affected as the source code found on Qt 4.6.1 is similar. Please, find attached an initial patch to fix the issue.
Comment on attachment 47028 [details] fix kfreebsd ftbfs Platforms that happen to have glibc are not OS(LINUX) and just because that's handy at one particular call site does not mean this is the correct way to do it. The right way to do this is to change the check at the strnstr definition, perhaps as described in the FIXME in StringExtras.h. Maciej Stachowiak is working on rationalizing Platform.h and might have a suggestion on the correct way to handle this.
Also, patches need a change log entry.
that's what I mean by "initial" patch :) I'm just waiting someone points me the way to go for a proper fix.
Created attachment 71477 [details] Patch to use HAVE_STRNSTRN
Proposed patch addresses the above and will help other affected platforms (like NetBSD) whose libc implementations lack strnstr.
Comment on attachment 71477 [details] Patch to use HAVE_STRNSTRN This patch will break non-configure-based platforms that have strnstr, which is the majority of platforms we support. Platform.h needs to set HAVE_STRNSTR for those platforms.