Split out macros from common.h

This commit is contained in:
Jeffrey Pfau 2014-10-11 18:18:47 -07:00
parent 4ecdcf25f5
commit 4247db81e4
41 changed files with 65 additions and 55 deletions

View File

@ -1,7 +1,7 @@
#ifndef ARM_H #ifndef ARM_H
#define ARM_H #define ARM_H
#include "common.h" #include "util/common.h"
enum { enum {
ARM_SP = 13, ARM_SP = 13,

View File

@ -1,7 +1,7 @@
#ifndef ISA_ARM_H #ifndef ISA_ARM_H
#define ISA_ARM_H #define ISA_ARM_H
#include "common.h" #include "util/common.h"
#define ARM_PREFETCH_CYCLES (1 + cpu->memory.activeSeqCycles32) #define ARM_PREFETCH_CYCLES (1 + cpu->memory.activeSeqCycles32)

View File

@ -1,7 +1,7 @@
#ifndef ISA_INLINES_H #ifndef ISA_INLINES_H
#define ISA_INLINES_H #define ISA_INLINES_H
#include "common.h" #include "macros.h"
#include "arm.h" #include "arm.h"

View File

@ -1,7 +1,7 @@
#ifndef ISA_THUMB_H #ifndef ISA_THUMB_H
#define ISA_THUMB_H #define ISA_THUMB_H
#include "common.h" #include "util/common.h"
struct ARMCore; struct ARMCore;

View File

@ -1,20 +1,7 @@
#ifndef COMMON_H #ifndef MACROS_H
#define COMMON_H #define MACROS_H
#include <ctype.h> #include "util/common.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)
#if defined(__PPC__) || defined(__POWERPC__) #if defined(__PPC__) || defined(__POWERPC__)
#define LOAD_32(DEST, ADDR, ARR) { \ #define LOAD_32(DEST, ADDR, ARR) { \

View File

@ -1,7 +1,7 @@
#ifndef CLI_DEBUGGER_H #ifndef CLI_DEBUGGER_H
#define CLI_DEBUGGER_H #define CLI_DEBUGGER_H
#include "common.h" #include "util/common.h"
#include "debugger.h" #include "debugger.h"

View File

@ -1,7 +1,7 @@
#ifndef DEBUGGER_H #ifndef DEBUGGER_H
#define DEBUGGER_H #define DEBUGGER_H
#include "common.h" #include "util/common.h"
#include "arm.h" #include "arm.h"

View File

@ -1,7 +1,7 @@
#ifndef GDB_STUB_H #ifndef GDB_STUB_H
#define GDB_STUB_H #define GDB_STUB_H
#include "common.h" #include "util/common.h"
#include "debugger/debugger.h" #include "debugger/debugger.h"

View File

@ -1,7 +1,7 @@
#ifndef MEMORY_DEBUGGER_H #ifndef MEMORY_DEBUGGER_H
#define MEMORY_DEBUGGER_H #define MEMORY_DEBUGGER_H
#include "common.h" #include "util/common.h"
#include "arm.h" #include "arm.h"

View File

@ -1,7 +1,7 @@
#ifndef PARSER_H #ifndef PARSER_H
#define PARSER_H #define PARSER_H
#include "common.h" #include "util/common.h"
#include "debugger.h" #include "debugger.h"
enum LexState { enum LexState {

View File

@ -1,7 +1,8 @@
#ifndef GBA_AUDIO_H #ifndef GBA_AUDIO_H
#define GBA_AUDIO_H #define GBA_AUDIO_H
#include "common.h" #include "util/common.h"
#include "macros.h"
#include "util/circle-buffer.h" #include "util/circle-buffer.h"

View File

@ -1,7 +1,7 @@
#ifndef GBA_BIOS_H #ifndef GBA_BIOS_H
#define GBA_BIOS_H #define GBA_BIOS_H
#include "common.h" #include "util/common.h"
#include "arm.h" #include "arm.h"

View File

@ -1,7 +1,7 @@
#ifndef GBA_GPIO_H #ifndef GBA_GPIO_H
#define 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) #define IS_GPIO_REGISTER(reg) ((reg) == GPIO_REG_DATA || (reg) == GPIO_REG_DIRECTION || (reg) == GPIO_REG_CONTROL)

View File

@ -1,7 +1,7 @@
#ifndef GBA_IO_H #ifndef GBA_IO_H
#define GBA_IO_H #define GBA_IO_H
#include "common.h" #include "util/common.h"
#include "gba.h" #include "gba.h"

View File

@ -1,5 +1,7 @@
#include "gba-memory.h" #include "gba-memory.h"
#include "macros.h"
#include "gba-gpio.h" #include "gba-gpio.h"
#include "gba-io.h" #include "gba-io.h"
#include "gba-serialize.h" #include "gba-serialize.h"

View File

@ -1,9 +1,10 @@
#ifndef GBA_MEMORY_H #ifndef GBA_MEMORY_H
#define GBA_MEMORY_H #define GBA_MEMORY_H
#include "common.h" #include "util/common.h"
#include "arm.h" #include "arm.h"
#include "macros.h"
#include "gba-gpio.h" #include "gba-gpio.h"
#include "gba-savedata.h" #include "gba-savedata.h"

View File

@ -1,7 +1,7 @@
#ifndef GBA_RR_H #ifndef GBA_RR_H
#define GBA_RR_H #define GBA_RR_H
#include "common.h" #include "util/common.h"
struct GBA; struct GBA;
struct VDir; struct VDir;

View File

@ -1,7 +1,7 @@
#ifndef GBA_SAVEDATA_H #ifndef GBA_SAVEDATA_H
#define GBA_SAVEDATA_H #define GBA_SAVEDATA_H
#include "common.h" #include "util/common.h"
struct VFile; struct VFile;

View File

@ -1,7 +1,7 @@
#ifndef GBA_SENSORS_H #ifndef GBA_SENSORS_H
#define GBA_SENSORS_H #define GBA_SENSORS_H
#include "common.h" #include "util/common.h"
struct GBARotationSource { struct GBARotationSource {
void (*sample)(struct GBARotationSource*); void (*sample)(struct GBARotationSource*);

View File

@ -1,7 +1,7 @@
#ifndef GBA_SERIALIZE_H #ifndef GBA_SERIALIZE_H
#define GBA_SERIALIZE_H #define GBA_SERIALIZE_H
#include "common.h" #include "util/common.h"
#include "gba.h" #include "gba.h"

View File

@ -1,7 +1,7 @@
#ifndef GBA_SIO_H #ifndef GBA_SIO_H
#define GBA_SIO_H #define GBA_SIO_H
#include "common.h" #include "util/common.h"
enum GBASIOMode { enum GBASIOMode {
SIO_NORMAL_8 = 0, SIO_NORMAL_8 = 0,

View File

@ -1,7 +1,7 @@
#ifndef GBA_THREAD_H #ifndef GBA_THREAD_H
#define GBA_THREAD_H #define GBA_THREAD_H
#include "common.h" #include "util/common.h"
#include "gba.h" #include "gba.h"
#include "gba-input.h" #include "gba-input.h"

View File

@ -1,9 +1,10 @@
#ifndef GBA_VIDEO_H #ifndef GBA_VIDEO_H
#define GBA_VIDEO_H #define GBA_VIDEO_H
#include "common.h" #include "util/common.h"
#include "gba-memory.h" #include "gba-memory.h"
#include "macros.h"
#ifdef COLOR_16_BIT #ifdef COLOR_16_BIT
#define BYTES_PER_PIXEL 2 #define BYTES_PER_PIXEL 2

View File

@ -1,7 +1,7 @@
#ifndef GBA_H #ifndef GBA_H
#define GBA_H #define GBA_H
#include "common.h" #include "util/common.h"
#include "arm.h" #include "arm.h"
#include "debugger/debugger.h" #include "debugger/debugger.h"

View File

@ -1,7 +1,7 @@
#ifndef HLE_BIOS_H #ifndef HLE_BIOS_H
#define HLE_BIOS_H #define HLE_BIOS_H
#include "common.h" #include "util/common.h"
extern const uint8_t hleBios[]; extern const uint8_t hleBios[];

View File

@ -1,7 +1,7 @@
#ifndef VIDEO_GLSL_H #ifndef VIDEO_GLSL_H
#define VIDEO_GLSL_H #define VIDEO_GLSL_H
#include "common.h" #include "util/common.h"
#include "gba-video.h" #include "gba-video.h"

View File

@ -1,7 +1,7 @@
#ifndef VIDEO_SOFTWARE_H #ifndef VIDEO_SOFTWARE_H
#define VIDEO_SOFTWARE_H #define VIDEO_SOFTWARE_H
#include "common.h" #include "util/common.h"
#include "gba-video.h" #include "gba-video.h"

View File

@ -1,7 +1,7 @@
#ifndef COMMAND_LINE_H #ifndef COMMAND_LINE_H
#define COMMAND_LINE_H #define COMMAND_LINE_H
#include "common.h" #include "util/common.h"
enum DebuggerType { enum DebuggerType {
DEBUGGER_NONE = 0, DEBUGGER_NONE = 0,

View File

@ -1,7 +1,7 @@
#ifndef SDL_AUDIO_H #ifndef SDL_AUDIO_H
#define SDL_AUDIO_H #define SDL_AUDIO_H
#include "common.h" #include "util/common.h"
#include <SDL.h> #include <SDL.h>

View File

@ -1,7 +1,7 @@
#ifndef SDL_EVENTS_H #ifndef SDL_EVENTS_H
#define SDL_EVENTS_H #define SDL_EVENTS_H
#include "common.h" #include "util/common.h"
#include "gba-thread.h" #include "gba-thread.h"

View File

@ -1,7 +1,7 @@
#ifndef CIRCLE_BUFFER_H #ifndef CIRCLE_BUFFER_H
#define CIRCLE_BUFFER_H #define CIRCLE_BUFFER_H
#include "common.h" #include "util/common.h"
struct CircleBuffer { struct CircleBuffer {
void* data; void* data;

19
src/util/common.h Normal file
View File

@ -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

View File

@ -1,8 +1,7 @@
#ifndef CRC32_H #ifndef CRC32_H
#define CRC32_H #define CRC32_H
#include <stdint.h> #include "util/common.h"
#include <string.h>
struct VFile; struct VFile;

View File

@ -1,7 +1,7 @@
#ifndef MEMORY_H #ifndef MEMORY_H
#define MEMORY_H #define MEMORY_H
#include "common.h" #include "util/common.h"
void* anonymousMemoryMap(size_t size); void* anonymousMemoryMap(size_t size);
void mappedMemoryFree(void* memory, size_t size); void mappedMemoryFree(void* memory, size_t size);

View File

@ -1,7 +1,7 @@
#ifndef PATCH_IPS_H #ifndef PATCH_IPS_H
#define PATCH_IPS_H #define PATCH_IPS_H
#include "common.h" #include "util/common.h"
struct Patch; struct Patch;

View File

@ -1,7 +1,7 @@
#ifndef PATCH_UPS_H #ifndef PATCH_UPS_H
#define PATCH_UPS_H #define PATCH_UPS_H
#include "common.h" #include "util/common.h"
struct Patch; struct Patch;

View File

@ -1,7 +1,7 @@
#ifndef PATCH_H #ifndef PATCH_H
#define PATCH_H #define PATCH_H
#include "common.h" #include "util/common.h"
struct VFile; struct VFile;

View File

@ -1,7 +1,7 @@
#ifndef PNG_IO_H #ifndef PNG_IO_H
#define PNG_IO_H #define PNG_IO_H
#include "common.h" #include "util/common.h"
#ifdef USE_PNG #ifdef USE_PNG

View File

@ -1,7 +1,7 @@
#ifndef SOCKET_H #ifndef SOCKET_H
#define SOCKET_H #define SOCKET_H
#include "common.h" #include "util/common.h"
#ifdef __cplusplus #ifdef __cplusplus
#define restrict __restrict__ #define restrict __restrict__

View File

@ -1,7 +1,7 @@
#ifndef THREADING_H #ifndef THREADING_H
#define THREADING_H #define THREADING_H
#include "common.h" #include "util/common.h"
#ifdef USE_PTHREADS #ifdef USE_PTHREADS
#include <pthread.h> #include <pthread.h>

View File

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