Fix cplusplus linkage error with extern C
This commit is contained in:
@ -52,11 +52,15 @@
|
||||
#if defined(vxWorks) || defined(__rtems__)
|
||||
// These systems have no strncasecmp at the moment
|
||||
// But avoid compiler errors in case strncasecmp exists in future versions
|
||||
static int mystrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
int r=0;
|
||||
while (n && (r = toupper(*s1)-toupper(*s2)) == 0) { n--; s1++; s2++; };
|
||||
return r;
|
||||
extern "C" {
|
||||
|
||||
static int mystrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
int r=0;
|
||||
while (n && (r = toupper(*s1)-toupper(*s2)) == 0) { n--; s1++; s2++; };
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
#define strncasecmp mystrncasecmp
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user