Browse Source

Compatibility update for MSVS

Added an implementation of strsep() that should work with MSVS.
Hopefully resolves issue #278
djm34
Yann St. Arnaud 11 years ago
parent
commit
83b2ac9ec7
  1. 19
      compat.h

19
compat.h

@ -70,6 +70,25 @@ static inline int setpriority(__maybe_unused int which, __maybe_unused int who,
return 0; return 0;
} }
//implement strsep() for windows
static char* strsep(char** stringp, const char* delim)
{
char* start = *stringp;
char* p;
p = ((start != NULL)?strpbrk(start, delim):NULL);
if(p == NULL)
*stringp = NULL;
else
{
*p = '\0';
*stringp = p + 1;
}
return start;
}
typedef unsigned long int ulong; typedef unsigned long int ulong;
typedef unsigned short int ushort; typedef unsigned short int ushort;
typedef unsigned int uint; typedef unsigned int uint;

Loading…
Cancel
Save