mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-24 14:33:25 +02:00
SameBoy Windows compilation fix that doesn't modify upstream.
This commit is contained in:
@@ -2,9 +2,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "gb.h"
|
#include "gb.h"
|
||||||
#ifdef _WIN32
|
|
||||||
#include "../Windows/getline.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool has_bank;
|
bool has_bank;
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
#define _GNU_SOURCE
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -12,9 +11,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "gb.h"
|
#include "gb.h"
|
||||||
#ifdef _WIN32
|
|
||||||
#include "../Windows/getline.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DISABLE_REWIND
|
#ifdef DISABLE_REWIND
|
||||||
#define GB_rewind_free(...)
|
#define GB_rewind_free(...)
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
flags += -DGB_INTERNAL -Wno-multichar
|
flags += -DGB_INTERNAL -DDISABLE_DEBUGGER -D_GNU_SOURCE -Wno-multichar
|
||||||
options += -I../sameboy
|
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-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-apu.o: gb/Core/apu.c
|
||||||
obj/gb-camera.o: gb/Core/camera.c
|
obj/gb-camera.o: gb/Core/camera.c
|
||||||
|
@@ -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;
|
|
||||||
}
|
|
Reference in New Issue
Block a user