#include "nasal.h"
-#ifndef _MSC_VER
// No need to include <string.h> 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)
{
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;
}
for(i=0; i<n; i++) {
naRef code = naNewCCode(c, funcs[i].func);
naRef name = naStr_fromdata(naNewString(c),
- funcs[i].name, strlen(funcs[i].name));
+ funcs[i].name, StrLen(funcs[i].name));
naHash_set(namespace, name, naNewFunc(c, code));
}
return namespace;