blob: 37a46b3d218cf875cd72c2af2ccbc18cbb0715a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
Work around a gcc-3.3.x bug where redefining prototypes with different
__THROW / attribute(nonnull) markings throws an error:
string.cpp:31: error: declaration of `char* strcasestr(const char*, const char*)' throws different exceptions
../include/string.h:46: error: than previous declaration `char* strcasestr(const char*, const char*) throw ()'
basically we just use the glibc strcasestr() instead of the internal one.
http://bugs.gentoo.org/show_bug.cgi?id=85780
--- libjsw/string.cpp
+++ libjsw/string.cpp
@@ -30,3 +30,5 @@
#endif
+#ifndef _GNU_SOURCE
char *strcasestr(const char *haystack, const char *needle);
+#endif
int strpfx(const char *s, const char *pfx);
@@ -218,4 +220,5 @@
* needle in haystack if found or NULL on no match.
*/
+#ifndef _GNU_SOURCE
char *strcasestr(const char *haystack, const char *needle)
{
@@ -274,6 +277,7 @@
return(NULL);
}
+#endif
/*
* Checks if string pfx is a prefix of string s.
|