/* -*- c++ -*- */ #ifndef CSTRING_INCLUDE #define CSTRING_INCLUDE #include namespace std { #if(__GNUC__>=3) // gcc pre 3.0 treats std:: as :: // so the following usings produce // already defined errors using ::memcpy; using ::memccpy; using ::memmove; using ::memccmp; using ::memcmp; using ::memset; using ::memchr; using ::strcpy; using ::strncpy; using ::strcat; using ::strncat; using ::strcmp; using ::strncmp; using ::strlen; using ::strspn; using ::strcspn; using ::strcoll; using ::strpbrk; using ::strrchr; using ::strchr; using ::strstr; // gcc pre 3.0 also don't know the __builtin_xxx // functions inline char* strpbrk(char* __s1, const char* __s2) { return __builtin_strpbrk(const_cast(__s1), __s2); } inline char* strrchr(char* __s1, int __n) { return __builtin_strrchr(const_cast(__s1), __n); } inline char* strchr(char* __s1, int __n) { return __builtin_strchr(const_cast(__s1), __n); } inline char* strstr(char* __s1, const char* __s2) { return __builtin_strstr(const_cast(__s1), __s2); } #endif }; #endif