Skip to content

Commit

Permalink
Compatibility update for MSVS
Browse files Browse the repository at this point in the history
Added an implementation of strsep() that should work with MSVS.
Hopefully resolves issue #278
  • Loading branch information
ystarnaud committed Jun 20, 2014
1 parent 3f83f22 commit 83b2ac9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,25 @@ static inline int setpriority(__maybe_unused int which, __maybe_unused int who,
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 short int ushort;
typedef unsigned int uint;
Expand Down

0 comments on commit 83b2ac9

Please sign in to comment.