diff --git a/simgear/nasal/lib.c b/simgear/nasal/lib.c index f9768d52..7597742c 100644 --- a/simgear/nasal/lib.c +++ b/simgear/nasal/lib.c @@ -1,14 +1,14 @@ #include "nasal.h" -#ifndef _MSC_VER // No need to include just for this: -static int strlen(char* s) +// It needs a funny name because MSVC wants to treat "strlen" as a +// special symbol. Ugh... +static int StrLen(char* s) { char* s0 = s; while(*s) s++; return s - s0; } -#endif static naRef size(naContext c, naRef args) { @@ -146,7 +146,7 @@ static naRef typeOf(naContext c, naRef args) else if(naIsHash(r)) t = "hash"; else if(naIsFunc(r)) t = "func"; else if(naIsGhost(r)) t = "ghost"; - r = naStr_fromdata(naNewString(c), t, strlen(t)); + r = naStr_fromdata(naNewString(c), t, StrLen(t)); return r; } @@ -174,7 +174,7 @@ naRef naStdLib(naContext c) for(i=0; i