mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
Compatibility update for MSVS
Added an implementation of strsep() that should work with MSVS. Hopefully resolves issue #278
This commit is contained in:
parent
3f83f221fb
commit
83b2ac9ec7
19
compat.h
19
compat.h
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user