Split out macros from common.h
Jeffrey Pfau jeffrey@endrift.com
Sat, 11 Oct 2014 18:18:47 -0700
41 files changed,
65 insertions(+),
55 deletions(-)
jump to
M
src/arm/arm.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.c
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/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.h
→
src/util/vfs.h
@@ -1,7 +1,7 @@
#ifndef VFS_H #define VFS_H -#include "common.h" +#include "util/common.h" enum { MAP_READ = 1,