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