forked from ground/ground
It compiles on windows now I guess
This commit is contained in:
19
src/parser.c
19
src/parser.c
@@ -5,6 +5,25 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
size_t strnlen(const char *src, size_t n) {
|
||||
size_t len = 0;
|
||||
while (len < n && src[len])
|
||||
len++;
|
||||
return len;
|
||||
}
|
||||
|
||||
char* strndup(const char *s, size_t n) {
|
||||
size_t len = strnlen(s, n);
|
||||
char *p = malloc(len + 1);
|
||||
if (p) {
|
||||
memcpy(p, s, len);
|
||||
p[len] = '\0';
|
||||
}
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
|
||||
GroundProgram createGroundProgram() {
|
||||
GroundProgram gp;
|
||||
gp.size = 0;
|
||||
|
||||
Reference in New Issue
Block a user