diff --git a/bsnes/gb/Core/debugger.c b/bsnes/gb/Core/debugger.c index db2cbe50..df480f34 100644 --- a/bsnes/gb/Core/debugger.c +++ b/bsnes/gb/Core/debugger.c @@ -2,9 +2,6 @@ #include #include #include "gb.h" -#ifdef _WIN32 - #include "../Windows/getline.h" -#endif typedef struct { bool has_bank; diff --git a/bsnes/gb/Core/gb.c b/bsnes/gb/Core/gb.c index 43a792c4..8c2330a4 100644 --- a/bsnes/gb/Core/gb.c +++ b/bsnes/gb/Core/gb.c @@ -1,4 +1,3 @@ -#define _GNU_SOURCE #include #include #include @@ -12,9 +11,6 @@ #endif #include "random.h" #include "gb.h" -#ifdef _WIN32 - #include "../Windows/getline.h" -#endif #ifdef DISABLE_REWIND #define GB_rewind_free(...) diff --git a/bsnes/gb/GNUmakefile b/bsnes/gb/GNUmakefile index 9da510cf..0bc486dd 100644 --- a/bsnes/gb/GNUmakefile +++ b/bsnes/gb/GNUmakefile @@ -1,9 +1,10 @@ -flags += -DGB_INTERNAL -Wno-multichar +flags += -DGB_INTERNAL -DDISABLE_DEBUGGER -D_GNU_SOURCE -Wno-multichar options += -I../sameboy -objects += gb-apu gb-camera gb-debugger gb-display gb-gb gb-joypad gb-mbc +objects += gb-apu gb-camera gb-display gb-gb gb-joypad gb-mbc objects += gb-memory gb-printer gb-random gb-rewind gb-save_state gb-sgb -objects += gb-sm83_cpu gb-sm83_disassembler gb-symbol_hash gb-timing +objects += gb-sm83_cpu gb-symbol_hash gb-timing +#objects+= gb-debugger gb-sm83_disassembler obj/gb-apu.o: gb/Core/apu.c obj/gb-camera.o: gb/Core/camera.c diff --git a/bsnes/gb/Windows/getline.h b/bsnes/gb/Windows/getline.h deleted file mode 100644 index ea90abcb..00000000 --- a/bsnes/gb/Windows/getline.h +++ /dev/null @@ -1,52 +0,0 @@ -/* This code is public domain -- Will Hartung 4/9/09 */ -static inline size_t getline(char **lineptr, size_t *n, FILE *stream) { - char *bufptr = NULL; - char *p = bufptr; - size_t size; - int c; - - if (lineptr == NULL) { - return -1; - } - if (stream == NULL) { - return -1; - } - if (n == NULL) { - return -1; - } - bufptr = *lineptr; - size = *n; - - c = fgetc(stream); - if (c == EOF) { - return -1; - } - if (bufptr == NULL) { - bufptr = malloc(128); - if (bufptr == NULL) { - return -1; - } - size = 128; - } - p = bufptr; - while (c != EOF) { - if ((p - bufptr) > (size - 1)) { - size = size + 128; - bufptr = realloc(bufptr, size); - if (bufptr == NULL) { - return -1; - } - } - *p++ = c; - if (c == '\n') { - break; - } - c = fgetc(stream); - } - - *p++ = '\0'; - *lineptr = bufptr; - *n = size; - - return p - bufptr - 1; -}