all repos — mgba @ 4247db81e43fb35526036b5538111a8dc3eb2606

mGBA Game Boy Advance Emulator

Split out macros from common.h
Jeffrey Pfau jeffrey@endrift.com
Sat, 11 Oct 2014 18:18:47 -0700
commit

4247db81e43fb35526036b5538111a8dc3eb2606

parent

4ecdcf25f53a0ca18fc7bc74640d8b1ee4291799

M src/arm/arm.hsrc/arm/arm.h

@@ -1,7 +1,7 @@

#ifndef ARM_H #define ARM_H -#include "common.h" +#include "util/common.h" enum { ARM_SP = 13,
M src/arm/common.hsrc/arm/macros.h

@@ -1,20 +1,7 @@

-#ifndef COMMON_H -#define COMMON_H +#ifndef MACROS_H +#define MACROS_H -#include <ctype.h> -#include <fcntl.h> -#include <limits.h> -#include <math.h> -#include <stdarg.h> -#include <stdbool.h> -#include <stddef.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#define UNUSED(V) (void)(V) +#include "util/common.h" #if defined(__PPC__) || defined(__POWERPC__) #define LOAD_32(DEST, ADDR, ARR) { \
M src/arm/isa-arm.hsrc/arm/isa-arm.h

@@ -1,7 +1,7 @@

#ifndef ISA_ARM_H #define ISA_ARM_H -#include "common.h" +#include "util/common.h" #define ARM_PREFETCH_CYCLES (1 + cpu->memory.activeSeqCycles32)
M src/arm/isa-inlines.hsrc/arm/isa-inlines.h

@@ -1,7 +1,7 @@

#ifndef ISA_INLINES_H #define ISA_INLINES_H -#include "common.h" +#include "macros.h" #include "arm.h"
M src/arm/isa-thumb.hsrc/arm/isa-thumb.h

@@ -1,7 +1,7 @@

#ifndef ISA_THUMB_H #define ISA_THUMB_H -#include "common.h" +#include "util/common.h" struct ARMCore;
M src/debugger/cli-debugger.hsrc/debugger/cli-debugger.h

@@ -1,7 +1,7 @@

#ifndef CLI_DEBUGGER_H #define CLI_DEBUGGER_H -#include "common.h" +#include "util/common.h" #include "debugger.h"
M src/debugger/debugger.hsrc/debugger/debugger.h

@@ -1,7 +1,7 @@

#ifndef DEBUGGER_H #define DEBUGGER_H -#include "common.h" +#include "util/common.h" #include "arm.h"
M src/debugger/gdb-stub.hsrc/debugger/gdb-stub.h

@@ -1,7 +1,7 @@

#ifndef GDB_STUB_H #define GDB_STUB_H -#include "common.h" +#include "util/common.h" #include "debugger/debugger.h"
M src/debugger/memory-debugger.hsrc/debugger/memory-debugger.h

@@ -1,7 +1,7 @@

#ifndef MEMORY_DEBUGGER_H #define MEMORY_DEBUGGER_H -#include "common.h" +#include "util/common.h" #include "arm.h"
M src/debugger/parser.hsrc/debugger/parser.h

@@ -1,7 +1,7 @@

#ifndef PARSER_H #define PARSER_H -#include "common.h" +#include "util/common.h" #include "debugger.h" enum LexState {
M src/gba/gba-audio.hsrc/gba/gba-audio.h

@@ -1,7 +1,8 @@

#ifndef GBA_AUDIO_H #define GBA_AUDIO_H -#include "common.h" +#include "util/common.h" +#include "macros.h" #include "util/circle-buffer.h"
M src/gba/gba-bios.hsrc/gba/gba-bios.h

@@ -1,7 +1,7 @@

#ifndef GBA_BIOS_H #define GBA_BIOS_H -#include "common.h" +#include "util/common.h" #include "arm.h"
M src/gba/gba-gpio.hsrc/gba/gba-gpio.h

@@ -1,7 +1,7 @@

#ifndef GBA_GPIO_H #define GBA_GPIO_H -#include "common.h" +#include "util/common.h" #define IS_GPIO_REGISTER(reg) ((reg) == GPIO_REG_DATA || (reg) == GPIO_REG_DIRECTION || (reg) == GPIO_REG_CONTROL)
M src/gba/gba-io.hsrc/gba/gba-io.h

@@ -1,7 +1,7 @@

#ifndef GBA_IO_H #define GBA_IO_H -#include "common.h" +#include "util/common.h" #include "gba.h"
M src/gba/gba-memory.csrc/gba/gba-memory.c

@@ -1,5 +1,7 @@

#include "gba-memory.h" +#include "macros.h" + #include "gba-gpio.h" #include "gba-io.h" #include "gba-serialize.h"
M src/gba/gba-memory.hsrc/gba/gba-memory.h

@@ -1,9 +1,10 @@

#ifndef GBA_MEMORY_H #define GBA_MEMORY_H -#include "common.h" +#include "util/common.h" #include "arm.h" +#include "macros.h" #include "gba-gpio.h" #include "gba-savedata.h"
M src/gba/gba-rr.hsrc/gba/gba-rr.h

@@ -1,7 +1,7 @@

#ifndef GBA_RR_H #define GBA_RR_H -#include "common.h" +#include "util/common.h" struct GBA; struct VDir;
M src/gba/gba-savedata.hsrc/gba/gba-savedata.h

@@ -1,7 +1,7 @@

#ifndef GBA_SAVEDATA_H #define GBA_SAVEDATA_H -#include "common.h" +#include "util/common.h" struct VFile;
M src/gba/gba-sensors.hsrc/gba/gba-sensors.h

@@ -1,7 +1,7 @@

#ifndef GBA_SENSORS_H #define GBA_SENSORS_H -#include "common.h" +#include "util/common.h" struct GBARotationSource { void (*sample)(struct GBARotationSource*);
M src/gba/gba-serialize.hsrc/gba/gba-serialize.h

@@ -1,7 +1,7 @@

#ifndef GBA_SERIALIZE_H #define GBA_SERIALIZE_H -#include "common.h" +#include "util/common.h" #include "gba.h"
M src/gba/gba-sio.hsrc/gba/gba-sio.h

@@ -1,7 +1,7 @@

#ifndef GBA_SIO_H #define GBA_SIO_H -#include "common.h" +#include "util/common.h" enum GBASIOMode { SIO_NORMAL_8 = 0,
M src/gba/gba-thread.hsrc/gba/gba-thread.h

@@ -1,7 +1,7 @@

#ifndef GBA_THREAD_H #define GBA_THREAD_H -#include "common.h" +#include "util/common.h" #include "gba.h" #include "gba-input.h"
M src/gba/gba-video.hsrc/gba/gba-video.h

@@ -1,9 +1,10 @@

#ifndef GBA_VIDEO_H #define GBA_VIDEO_H -#include "common.h" +#include "util/common.h" #include "gba-memory.h" +#include "macros.h" #ifdef COLOR_16_BIT #define BYTES_PER_PIXEL 2
M src/gba/gba.hsrc/gba/gba.h

@@ -1,7 +1,7 @@

#ifndef GBA_H #define GBA_H -#include "common.h" +#include "util/common.h" #include "arm.h" #include "debugger/debugger.h"
M src/gba/hle-bios.hsrc/gba/hle-bios.h

@@ -1,7 +1,7 @@

#ifndef HLE_BIOS_H #define HLE_BIOS_H -#include "common.h" +#include "util/common.h" extern const uint8_t hleBios[];
M src/gba/renderers/video-glsl.hsrc/gba/renderers/video-glsl.h

@@ -1,7 +1,7 @@

#ifndef VIDEO_GLSL_H #define VIDEO_GLSL_H -#include "common.h" +#include "util/common.h" #include "gba-video.h"
M src/gba/renderers/video-software.hsrc/gba/renderers/video-software.h

@@ -1,7 +1,7 @@

#ifndef VIDEO_SOFTWARE_H #define VIDEO_SOFTWARE_H -#include "common.h" +#include "util/common.h" #include "gba-video.h"
M src/platform/commandline.hsrc/platform/commandline.h

@@ -1,7 +1,7 @@

#ifndef COMMAND_LINE_H #define COMMAND_LINE_H -#include "common.h" +#include "util/common.h" enum DebuggerType { DEBUGGER_NONE = 0,
M src/platform/sdl/sdl-audio.hsrc/platform/sdl/sdl-audio.h

@@ -1,7 +1,7 @@

#ifndef SDL_AUDIO_H #define SDL_AUDIO_H -#include "common.h" +#include "util/common.h" #include <SDL.h>
M src/platform/sdl/sdl-events.hsrc/platform/sdl/sdl-events.h

@@ -1,7 +1,7 @@

#ifndef SDL_EVENTS_H #define SDL_EVENTS_H -#include "common.h" +#include "util/common.h" #include "gba-thread.h"
M src/util/circle-buffer.hsrc/util/circle-buffer.h

@@ -1,7 +1,7 @@

#ifndef CIRCLE_BUFFER_H #define CIRCLE_BUFFER_H -#include "common.h" +#include "util/common.h" struct CircleBuffer { void* data;
A src/util/common.h

@@ -0,0 +1,19 @@

+#ifndef COMMON_H +#define COMMON_H + +#include <ctype.h> +#include <fcntl.h> +#include <limits.h> +#include <math.h> +#include <stdarg.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#define UNUSED(V) (void)(V) + +#endif
M src/util/crc32.hsrc/util/crc32.h

@@ -1,8 +1,7 @@

#ifndef CRC32_H #define CRC32_H -#include <stdint.h> -#include <string.h> +#include "util/common.h" struct VFile;
M src/util/memory.hsrc/util/memory.h

@@ -1,7 +1,7 @@

#ifndef MEMORY_H #define MEMORY_H -#include "common.h" +#include "util/common.h" void* anonymousMemoryMap(size_t size); void mappedMemoryFree(void* memory, size_t size);
M src/util/patch-ips.hsrc/util/patch-ips.h

@@ -1,7 +1,7 @@

#ifndef PATCH_IPS_H #define PATCH_IPS_H -#include "common.h" +#include "util/common.h" struct Patch;
M src/util/patch-ups.hsrc/util/patch-ups.h

@@ -1,7 +1,7 @@

#ifndef PATCH_UPS_H #define PATCH_UPS_H -#include "common.h" +#include "util/common.h" struct Patch;
M src/util/patch.hsrc/util/patch.h

@@ -1,7 +1,7 @@

#ifndef PATCH_H #define PATCH_H -#include "common.h" +#include "util/common.h" struct VFile;
M src/util/png-io.hsrc/util/png-io.h

@@ -1,7 +1,7 @@

#ifndef PNG_IO_H #define PNG_IO_H -#include "common.h" +#include "util/common.h" #ifdef USE_PNG
M src/util/socket.hsrc/util/socket.h

@@ -1,7 +1,7 @@

#ifndef SOCKET_H #define SOCKET_H -#include "common.h" +#include "util/common.h" #ifdef __cplusplus #define restrict __restrict__
M src/util/threading.hsrc/util/threading.h

@@ -1,7 +1,7 @@

#ifndef THREADING_H #define THREADING_H -#include "common.h" +#include "util/common.h" #ifdef USE_PTHREADS #include <pthread.h>
M src/util/vfs.hsrc/util/vfs.h

@@ -1,7 +1,7 @@

#ifndef VFS_H #define VFS_H -#include "common.h" +#include "util/common.h" enum { MAP_READ = 1,