All: Add C++ header guards
jump to
@@ -8,6 +8,8 @@ #define ARM_H
#include "util/common.h" +CXX_GUARD_START + #include "core/cpu.h" enum {@@ -174,5 +176,7 @@
void ARMRun(struct ARMCore* cpu); void ARMRunLoop(struct ARMCore* cpu); void ARMRunFake(struct ARMCore* cpu, uint32_t opcode); + +CXX_GUARD_END #endif
@@ -8,7 +8,11 @@ #define ARM_CLI_DEBUGGER_H
#include "util/common.h" +CXX_GUARD_START + struct CLIDebuggerSystem; void ARMCLIDebuggerCreate(struct CLIDebuggerSystem* debugger); + +CXX_GUARD_END #endif
@@ -3,6 +3,13 @@ *
* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef ARM_DEBUGGER_H +#define ARM_DEBUGGER_H + +#include "util/common.h" + +CXX_GUARD_START + #include "debugger/debugger.h" struct ARMDebugBreakpoint {@@ -40,3 +47,7 @@
struct mDebuggerPlatform* ARMDebuggerPlatformCreate(void); bool ARMDebuggerSetSoftwareBreakpoint(struct mDebuggerPlatform* debugger, uint32_t address, enum ExecutionMode mode); void ARMDebuggerClearSoftwareBreakpoint(struct mDebuggerPlatform* debugger, uint32_t address); + +CXX_GUARD_END + +#endif
@@ -8,9 +8,13 @@ #define MEMORY_DEBUGGER_H
#include "util/common.h" +CXX_GUARD_START + struct ARMDebugger; void ARMDebuggerInstallMemoryShim(struct ARMDebugger* debugger); void ARMDebuggerRemoveMemoryShim(struct ARMDebugger* debugger); + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef ARM_DECODER_H #define ARM_DECODER_H +#include "util/common.h" + +CXX_GUARD_START + #include "arm.h" // Bit 0: a register is involved with this operand@@ -213,5 +217,7 @@ void ARMDecodeThumb(uint16_t opcode, struct ARMInstructionInfo* info);
bool ARMDecodeThumbCombine(struct ARMInstructionInfo* info1, struct ARMInstructionInfo* info2, struct ARMInstructionInfo* out); int ARMDisassemble(struct ARMInstructionInfo* info, uint32_t pc, char* buffer, int blen); + +CXX_GUARD_END #endif
@@ -8,11 +8,15 @@ #define ISA_ARM_H
#include "util/common.h" +CXX_GUARD_START + #define ARM_PREFETCH_CYCLES (1 + cpu->memory.activeSeqCycles32) struct ARMCore; typedef void (*ARMInstruction)(struct ARMCore*, uint32_t opcode); extern const ARMInstruction _armTable[0x1000]; + +CXX_GUARD_END #endif
@@ -8,9 +8,13 @@ #define ISA_THUMB_H
#include "util/common.h" +CXX_GUARD_START + struct ARMCore; typedef void (*ThumbInstruction)(struct ARMCore*, uint16_t opcode); extern const ThumbInstruction _thumbTable[0x400]; + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define CHEATS_H
#include "util/common.h" +CXX_GUARD_START + #include "core/cpu.h" #include "core/log.h" #include "util/vector.h"@@ -99,5 +101,7 @@ bool mCheatParseFile(struct mCheatDevice*, struct VFile*);
bool mCheatSaveFile(struct mCheatDevice*, struct VFile*); void mCheatRefresh(struct mCheatDevice*, struct mCheatSet*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_CORE_CONFIG_H
#include "util/common.h" +CXX_GUARD_START + #include "util/configuration.h" struct mCoreConfig {@@ -90,5 +92,7 @@ struct Configuration* mCoreConfigGetOverrides(struct mCoreConfig*);
const struct Configuration* mCoreConfigGetOverridesConst(const struct mCoreConfig*); void mCoreConfigFreeOpts(struct mCoreOptions* opts); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_CORE_H
#include "util/common.h" +CXX_GUARD_START + #include "core/config.h" #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 #include "core/directories.h"@@ -158,5 +160,7 @@
void mCoreInitConfig(struct mCore* core, const char* port); void mCoreLoadConfig(struct mCore* core); void mCoreLoadForeignConfig(struct mCore* core, const struct mCoreConfig* config); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_CPU_H
#include "util/common.h" +CXX_GUARD_START + enum mCPUComponentType { CPU_COMPONENT_DEBUGGER, CPU_COMPONENT_CHEAT_DEVICE,@@ -19,5 +21,7 @@ uint32_t id;
void (*init)(void* cpu, struct mCPUComponent* component); void (*deinit)(struct mCPUComponent* component); }; + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define DIRECTORIES_H
#include "util/common.h" +CXX_GUARD_START + #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 struct VDir;@@ -33,5 +35,7 @@
struct mCoreOptions; void mDirectorySetMapOptions(struct mDirectorySet* dirs, const struct mCoreOptions* opts); #endif + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_INPUT_H
#include "util/common.h" +CXX_GUARD_START + struct Configuration; struct mInputPlatformInfo {@@ -59,5 +61,7 @@ const char* mInputGetCustomValue(const struct Configuration* config, const char* platformName, uint32_t type, const char* key,
const char* profile); void mInputSetCustomValue(struct Configuration* config, const char* platformName, uint32_t type, const char* key, const char* value, const char* profile); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define CORE_INTERFACE_H
#include "util/common.h" +CXX_GUARD_START + struct mCore; #ifdef COLOR_16_BIT@@ -83,5 +85,7 @@
struct mRumble { void (*setRumble)(struct mRumble*, int enable); }; + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_LIBRARY_H
#include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "util/vector.h"@@ -33,5 +35,7 @@ struct VDir;
struct VFile; void mLibraryLoadDirectory(struct mLibrary* library, struct VDir* dir); void mLibraryAddEntry(struct mLibrary* library, const char* filename, struct VFile* vf); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define SIO_LOCKSTEP_H
#include "util/common.h" +CXX_GUARD_START + enum mLockstepPhase { TRANSFER_IDLE = 0, TRANSFER_STARTING,@@ -33,5 +35,7 @@ #endif
}; void mLockstepInit(struct mLockstep*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_LOG_H
#include "util/common.h" +CXX_GUARD_START + enum mLogLevel { mLOG_FATAL = 0x01, mLOG_ERROR = 0x02,@@ -57,5 +59,7 @@ return category; \
} mLOG_DECLARE_CATEGORY(STATUS) + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_CORE_REWIND_H
#include "util/common.h" +CXX_GUARD_START + #include "util/vector.h" DECLARE_VECTOR(mCoreRewindPatches, struct PatchFast);@@ -27,5 +29,7 @@
struct mCore; void mCoreRewindAppend(struct mCoreRewindContext*, struct mCore*); bool mCoreRewindRestore(struct mCoreRewindContext*, struct mCore*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_SERIALIZE_H
#include "util/common.h" +CXX_GUARD_START + enum mStateExtdataTag { EXTDATA_NONE = 0, EXTDATA_SCREENSHOT = 1,@@ -43,5 +45,7 @@ struct mCore;
bool mCoreSaveStateNamed(struct mCore* core, struct VFile* vf, int flags); bool mCoreLoadStateNamed(struct mCore* core, struct VFile* vf, int flags); void* mCoreExtractState(struct mCore* core, struct VFile* vf, struct mStateExtdata* extdata); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_CORE_SYNC_H
#include "util/common.h" +CXX_GUARD_START + #include "util/threading.h" struct mCoreSync {@@ -35,5 +37,7 @@ void mCoreSyncProduceAudio(struct mCoreSync* sync, bool wait);
void mCoreSyncLockAudio(struct mCoreSync* sync); void mCoreSyncUnlockAudio(struct mCoreSync* sync); void mCoreSyncConsumeAudio(struct mCoreSync* sync); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_CORE_THREAD_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "core/rewind.h" #include "core/sync.h"@@ -96,5 +98,7 @@ void mCoreThreadSetRewinding(struct mCoreThread* threadContext, bool);
struct mCoreThread* mCoreThreadGet(void); struct mLogger* mCoreThreadLogger(void); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_TILE_CACHE_H
#include "util/common.h" +CXX_GUARD_START + DECL_BITFIELD(mTileCacheConfiguration, uint32_t); DECL_BIT(mTileCacheConfiguration, ShouldStore, 0);@@ -56,5 +58,7 @@ void mTileCacheSetPalette(struct mTileCache* cache, int palette);
const uint16_t* mTileCacheGetTile(struct mTileCache* cache, unsigned tileId, unsigned paletteId); const uint16_t* mTileCacheGetTileIfDirty(struct mTileCache* cache, struct mTileCacheEntry* entry, unsigned tileId, unsigned paletteId); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define M_CORE_TIMING
#include "util/common.h" +CXX_GUARD_START + struct mTiming; struct mTimingEvent { void* context;@@ -36,5 +38,7 @@ bool mTimingIsScheduled(const struct mTiming* timing, const struct mTimingEvent*);
int32_t mTimingTick(struct mTiming* timing, int32_t cycles); int32_t mTimingCurrentTime(const struct mTiming* timing); int32_t mTimingNextEvent(struct mTiming* timing); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define CLI_DEBUGGER_H
#include "util/common.h" +CXX_GUARD_START + #include "debugger.h" struct CLIDebugger;@@ -85,5 +87,7 @@ void CLIDebuggerAttachSystem(struct CLIDebugger*, struct CLIDebuggerSystem*);
void CLIDebuggerAttachBackend(struct CLIDebugger*, struct CLIDebuggerBackend*); bool CLIDebuggerTabComplete(struct CLIDebugger*, const char* token, bool initial, size_t len); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define DEBUGGER_H
#include "util/common.h" +CXX_GUARD_START + #include "arm/arm.h" #include "core/log.h" #include "util/vector.h"@@ -111,5 +113,6 @@ void mDebuggerAttach(struct mDebugger*, struct mCore*);
void mDebuggerRun(struct mDebugger*); void mDebuggerEnter(struct mDebugger*, enum mDebuggerEntryReason, struct mDebuggerEntryInfo*); +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GDB_STUB_H
#include "util/common.h" +CXX_GUARD_START + #include "debugger/debugger.h" #include "util/socket.h"@@ -46,5 +48,7 @@ void GDBStubHangup(struct GDBStub*);
void GDBStubShutdown(struct GDBStub*); void GDBStubUpdate(struct GDBStub*); + +CXX_GUARD_END #endif
@@ -7,6 +7,9 @@ #ifndef PARSER_H
#define PARSER_H #include "util/common.h" + +CXX_GUARD_START + #include "debugger.h" enum LexState {@@ -61,5 +64,7 @@ void parseLexedExpression(struct ParseTree* tree, struct LexVector* lv);
void lexFree(struct LexVector* lv); void parseFree(struct ParseTree* tree); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define COMMAND_LINE_H
#include "util/common.h" +CXX_GUARD_START + #include "debugger/debugger.h" struct mArguments {@@ -48,5 +50,7 @@ void usage(const char* arg0, const char* extraOptions);
void version(const char* arg0); void initParserForGraphics(struct mSubParser* parser, struct mGraphicsOpts* opts); + +CXX_GUARD_END #endif
@@ -6,8 +6,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef CLI_EL_BACKEND_H #define CLI_EL_BACKEND_H +#include "util/common.h" + +CXX_GUARD_START + #include "debugger/cli-debugger.h" -#include "util/common.h" #include <histedit.h>@@ -19,5 +22,7 @@ History* histate;
}; struct CLIDebuggerBackend* CLIDebuggerEditLineBackendCreate(void); + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef FFMPEG_ENCODER #define FFMPEG_ENCODER +#include "util/common.h" + +CXX_GUARD_START + #include "gba/gba.h" #include <libavformat/avformat.h>@@ -82,5 +86,7 @@ bool FFmpegEncoderVerifyContainer(struct FFmpegEncoder*);
bool FFmpegEncoderOpen(struct FFmpegEncoder*, const char* outfile); void FFmpegEncoderClose(struct FFmpegEncoder*); bool FFmpegEncoderIsOpen(struct FFmpegEncoder*); + +CXX_GUARD_END #endif
@@ -8,8 +8,12 @@ #define GUI_CONFIG_H
#include "util/common.h" +CXX_GUARD_START + struct mGUIRunner; struct GUIMenuItem; void mGUIShowConfig(struct mGUIRunner* runner, struct GUIMenuItem* extra, size_t nExtra); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GUI_RUNNER_H
#include "util/common.h" +CXX_GUARD_START + #include "core/config.h" #include "feature/gui/remap.h" #include "gba/hardware.h"@@ -74,5 +76,7 @@ void mGUIInit(struct mGUIRunner*, const char* port);
void mGUIDeinit(struct mGUIRunner*); void mGUIRun(struct mGUIRunner*, const char* path); void mGUIRunloop(struct mGUIRunner*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GUI_REMAP_H
#include "util/common.h" +CXX_GUARD_START + struct GUIInputKeys { const char* name; uint32_t id;@@ -19,5 +21,7 @@ struct GUIParams;
struct mInputMap; void mGUIRemapKeys(struct GUIParams*, struct mInputMap*, const struct GUIInputKeys*); + +CXX_GUARD_END #endif
@@ -5,6 +5,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "imagemagick-gif-encoder.h" +#include "gba/gba.h" #include "gba/video.h" #include "util/string.h"
@@ -6,7 +6,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef IMAGEMAGICK_GIF_ENCODER #define IMAGEMAGICK_GIF_ENCODER -#include "gba/gba.h" +#include "util/common.h" + +CXX_GUARD_START + +#include "core/interface.h" #define MAGICKCORE_HDRI_ENABLE 0 #define MAGICKCORE_QUANTUM_DEPTH 8@@ -32,5 +36,7 @@ void ImageMagickGIFEncoderSetParams(struct ImageMagickGIFEncoder* encoder, int frameskip, int delayMs);
bool ImageMagickGIFEncoderOpen(struct ImageMagickGIFEncoder*, const char* outfile); bool ImageMagickGIFEncoderClose(struct ImageMagickGIFEncoder*); bool ImageMagickGIFEncoderIsOpen(struct ImageMagickGIFEncoder*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_AUDIO_H
#include "util/common.h" +CXX_GUARD_START + #include "core/timing.h" #include "third-party/blip_buf/blip_buf.h"@@ -239,5 +241,7 @@
struct GBSerializedState; void GBAudioSerialize(const struct GBAudio* audio, struct GBSerializedState* state); void GBAudioDeserialize(struct GBAudio* audio, const struct GBSerializedState* state); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_CHEATS_H
#include "util/common.h" +CXX_GUARD_START + #include "core/cheats.h" #include "util/vector.h"@@ -35,5 +37,7 @@ struct GBCheatPatchList romPatches;
}; struct mCheatDevice* GBCheatDeviceCreate(void); + +CXX_GUARD_END #endif
@@ -6,7 +6,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GB_CORE_H #define GB_CORE_H +#include "util/common.h" + +CXX_GUARD_START + struct mCore; struct mCore* GBCoreCreate(void); + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GB_CLI_H #define GB_CLI_H +#include "util/common.h" + +CXX_GUARD_START + #include "debugger/cli-debugger.h" struct GBCLIDebugger {@@ -18,5 +22,7 @@ bool inVblank;
}; struct CLIDebuggerSystem* GBCLIDebuggerCreate(struct mCore*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "core/timing.h"@@ -140,5 +142,7 @@ void GBGetGameTitle(const struct GB* gba, char* out);
void GBGetGameCode(const struct GB* gba, char* out); void GBFrameEnded(struct GB* gb); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_INTERFACE_H
#include "util/common.h" +CXX_GUARD_START + enum GBModel { GB_MODEL_AUTODETECT = 0xFF, GB_MODEL_DMG = 0x00,@@ -31,5 +33,7 @@ GB_HuC3 = 0x12,
GB_MBC3_RTC = 0x103, GB_MBC5_RUMBLE = 0x105 }; + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_IO_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" mLOG_DECLARE_CATEGORY(GB_IO);@@ -117,5 +119,7 @@
struct GBSerializedState; void GBIOSerialize(const struct GB* gb, struct GBSerializedState* state); void GBIODeserialize(struct GB* gb, const struct GBSerializedState* state); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_MBC_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" mLOG_DECLARE_CATEGORY(GB_MBC);@@ -36,5 +38,7 @@ void GBMBCRTCWrite(struct GB* gb);
uint8_t GBMBC7Read(struct GBMemory*, uint16_t address); void GBMBC7Write(struct GBMemory*, uint16_t address, uint8_t value); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_MEMORY_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "core/timing.h" #include "gb/interface.h"@@ -174,5 +176,7 @@
struct GBSerializedState; void GBMemorySerialize(const struct GB* gb, struct GBSerializedState* state); void GBMemoryDeserialize(struct GB* gb, const struct GBSerializedState* state); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_OVERRIDES_H
#include "util/common.h" +CXX_GUARD_START + #include "gb/interface.h" struct GBCartridgeOverride {@@ -23,5 +25,7 @@
struct GB; void GBOverrideApply(struct GB*, const struct GBCartridgeOverride*); void GBOverrideApplyDefaults(struct GB*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_RENDERER_SOFTWARE_H
#include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "gb/gb.h" #include "gb/video.h"@@ -35,5 +37,7 @@ enum GBModel model;
}; void GBVideoSoftwareRendererCreate(struct GBVideoSoftwareRenderer*); + +CXX_GUARD_END #endif
@@ -8,10 +8,14 @@ #define GB_TILE_CACHE_H
#include "util/common.h" +CXX_GUARD_START + struct GBVideo; struct mTileCache; void GBVideoTileCacheInit(struct mTileCache* cache); void GBVideoTileCacheAssociate(struct mTileCache* cache, struct GBVideo* video); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_SERIALIZE_H
#include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "gb/gb.h"@@ -369,5 +371,7 @@ #pragma pack(pop)
bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state); void GBSerialize(struct GB* gb, struct GBSerializedState* state); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_SIO_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "core/timing.h"@@ -52,5 +54,7 @@ void GBSIODeinit(struct GBSIO* sio);
void GBSIOSetDriver(struct GBSIO* sio, struct GBSIODriver* driver); void GBSIOWriteSC(struct GBSIO* sio, uint8_t sc); void GBSIOWriteSB(struct GBSIO* sio, uint8_t sb); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_SIO_LOCKSTEP_H
#include "util/common.h" +CXX_GUARD_START + #include "core/lockstep.h" #include "core/timing.h" #include "gb/sio.h"@@ -41,5 +43,7 @@ void GBSIOLockstepNodeCreate(struct GBSIOLockstepNode*);
bool GBSIOLockstepAttachNode(struct GBSIOLockstep*, struct GBSIOLockstepNode*); void GBSIOLockstepDetachNode(struct GBSIOLockstep*, struct GBSIOLockstepNode*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_TIMER_H
#include "util/common.h" +CXX_GUARD_START + #include "core/timing.h" DECL_BITFIELD(GBRegisterTAC, uint8_t);@@ -37,5 +39,7 @@
struct GBSerializedState; void GBTimerSerialize(const struct GBTimer* timer, struct GBSerializedState* state); void GBTimerDeserialize(struct GBTimer* timer, const struct GBSerializedState* state); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GB_VIDEO_H
#include "util/common.h" +CXX_GUARD_START + #include "core/interface.h" #include "core/timing.h" #include "gb/interface.h"@@ -142,5 +144,7 @@
struct GBSerializedState; void GBVideoSerialize(const struct GBVideo* video, struct GBSerializedState* state); void GBVideoDeserialize(struct GBVideo* video, const struct GBSerializedState* state); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_AUDIO_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "gb/audio.h" #include "util/circle-buffer.h"@@ -115,5 +117,7 @@ void GBAAudioSerialize(const struct GBAAudio* audio, struct GBASerializedState* state);
void GBAAudioDeserialize(struct GBAAudio* audio, const struct GBASerializedState* state); float GBAAudioCalculateRatio(float inputSampleRate, float desiredFPS, float desiredSampleRatio); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_BIOS_H
#include "util/common.h" +CXX_GUARD_START + #include "arm/arm.h" #include "core/log.h"@@ -19,5 +21,7 @@
uint32_t GBAChecksum(uint32_t* memory, size_t size); extern const uint32_t GBA_BIOS_CHECKSUM; extern const uint32_t GBA_DS_BIOS_CHECKSUM; + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_CHEATS_H
#include "util/common.h" +CXX_GUARD_START + #include "arm/arm.h" #include "core/cheats.h"@@ -173,5 +175,7 @@
bool GBACheatAddVBALine(struct GBACheatSet*, const char* line); int GBACheatAddressIsReal(uint32_t address); + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GBA_CHEATS_GAMESHARK_H #define GBA_CHEATS_GAMESHARK_H +#include "util/common.h" + +CXX_GUARD_START + #include "gba/cheats.h" extern const uint32_t GBACheatGameSharkSeeds[4];@@ -15,5 +19,7 @@ void GBACheatReseedGameShark(uint32_t* seeds, uint16_t params, const uint8_t* t1, const uint8_t* t2);
void GBACheatSetGameSharkVersion(struct GBACheatSet* cheats, int version); bool GBACheatAddGameSharkRaw(struct GBACheatSet* cheats, uint32_t op1, uint32_t op2); int GBACheatGameSharkProbability(uint32_t op1, uint32_t op2); + +CXX_GUARD_END #endif
@@ -6,11 +6,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GBA_CHEATS_PARV3_H #define GBA_CHEATS_PARV3_H +#include "util/common.h" + +CXX_GUARD_START + #include "gba/cheats.h" extern const uint32_t GBACheatProActionReplaySeeds[4]; bool GBACheatAddProActionReplayRaw(struct GBACheatSet* cheats, uint32_t op1, uint32_t op2); int GBACheatProActionReplayProbability(uint32_t op1, uint32_t op2); + +CXX_GUARD_END #endif
@@ -6,7 +6,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GBA_CORE_H #define GBA_CORE_H +#include "util/common.h" + +CXX_GUARD_START + struct mCore; struct mCore* GBACoreCreate(void); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_DMA_H
#include "util/common.h" +CXX_GUARD_START + struct GBA; void GBADMAInit(struct GBA* gba); void GBADMAReset(struct GBA* gba);@@ -22,5 +24,7 @@ void GBADMASchedule(struct GBA* gba, int number, struct GBADMA* info);
void GBADMARunHblank(struct GBA* gba, int32_t cycles); void GBADMARunVblank(struct GBA* gba, int32_t cycles); void GBADMAUpdate(struct GBA* gba); + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GBA_CLI_H #define GBA_CLI_H +#include "util/common.h" + +CXX_GUARD_START + #include "debugger/cli-debugger.h" struct mCore;@@ -20,5 +24,7 @@ bool inVblank;
}; struct GBACLIDebugger* GBACLIDebuggerCreate(struct mCore*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_H
#include "util/common.h" +CXX_GUARD_START + #include "arm/arm.h" #include "core/log.h" #include "core/timing.h"@@ -174,5 +176,7 @@ void GBAGetGameTitle(const struct GBA* gba, char* out);
void GBAFrameStarted(struct GBA* gba); void GBAFrameEnded(struct GBA* gba); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_HARDWARE_H
#include "util/common.h" +CXX_GUARD_START + #include "arm/macros.h" #include "core/log.h" #include "core/timing.h"@@ -143,5 +145,7 @@
struct GBASerializedState; void GBAHardwareSerialize(const struct GBACartridgeHardware* gpio, struct GBASerializedState* state); void GBAHardwareDeserialize(struct GBACartridgeHardware* gpio, const struct GBASerializedState* state); + +CXX_GUARD_END #endif
@@ -8,6 +8,10 @@ #define HLE_BIOS_H
#include "util/common.h" +CXX_GUARD_START + extern const uint8_t hleBios[]; + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GBA_INPUT_H #define GBA_INPUT_H +#include "util/common.h" + +CXX_GUARD_START + #include "core/input.h" extern const struct mInputPlatformInfo GBAInputInfo;@@ -24,5 +28,7 @@ GBA_KEY_L = 9,
GBA_KEY_MAX, GBA_KEY_NONE = -1 }; + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_INTERFACE_H
#include "util/common.h" +CXX_GUARD_START + #include "core/interface.h" enum GBASIOMode {@@ -41,5 +43,7 @@ bool (*load)(struct GBASIODriver* driver);
bool (*unload)(struct GBASIODriver* driver); uint16_t (*writeRegister)(struct GBASIODriver* driver, uint32_t address, uint16_t value); }; + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_IO_H
#include "util/common.h" +CXX_GUARD_START + #include "gba/gba.h" enum GBAIORegisters {@@ -172,5 +174,7 @@
struct GBASerializedState; void GBAIOSerialize(struct GBA* gba, struct GBASerializedState* state); void GBAIODeserialize(struct GBA* gba, const struct GBASerializedState* state); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_MEMORY_H
#include "util/common.h" +CXX_GUARD_START + #include "arm/arm.h" #include "core/timing.h"@@ -179,5 +181,7 @@
struct GBASerializedState; void GBAMemorySerialize(const struct GBAMemory* memory, struct GBASerializedState* state); void GBAMemoryDeserialize(struct GBAMemory* memory, const struct GBASerializedState* state); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_OVERRIDES_H
#include "util/common.h" +CXX_GUARD_START + #include "gba/savedata.h" #define IDLE_LOOP_NONE 0xFFFFFFFF@@ -27,5 +29,7 @@
struct GBA; void GBAOverrideApply(struct GBA*, const struct GBACartridgeOverride*); void GBAOverrideApplyDefaults(struct GBA*); + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef VIDEO_THREAD_PROXY_H #define VIDEO_THREAD_PROXY_H +#include "util/common.h" + +CXX_GUARD_START + #include "gba/video.h" #include "util/threading.h" #include "util/ring-fifo.h"@@ -37,5 +41,7 @@ uint16_t paletteProxy[512];
}; void GBAVideoThreadProxyRendererCreate(struct GBAVideoThreadProxyRenderer* renderer, struct GBAVideoRenderer* backend); + +CXX_GUARD_END #endif
@@ -8,10 +8,14 @@ #define GBA_TILE_CACHE_H
#include "util/common.h" +CXX_GUARD_START + struct GBAVideo; struct mTileCache; void GBAVideoTileCacheInit(struct mTileCache* cache); void GBAVideoTileCacheAssociate(struct mTileCache* cache, struct GBAVideo* video); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define VIDEO_SOFTWARE_H
#include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "gba/video.h"@@ -161,5 +163,7 @@ int end;
}; void GBAVideoSoftwareRendererCreate(struct GBAVideoSoftwareRenderer* renderer); + +CXX_GUARD_START #endif
@@ -8,6 +8,8 @@ #define RR_MGM_H
#include "util/common.h" +CXX_GUARD_START + #include "gba/rr/rr.h" struct GBA;@@ -79,5 +81,7 @@ void GBAMGMContextCreate(struct GBAMGMContext*);
bool GBAMGMSetStream(struct GBAMGMContext* mgm, struct VDir* stream); bool GBAMGMCreateStream(struct GBAMGMContext* mgm, enum GBARRInitFrom initFrom); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_RR_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "gba/serialize.h"@@ -57,5 +59,7 @@ void GBARRDestroy(struct GBARRContext*);
void GBARRInitRecord(struct GBA*); void GBARRInitPlay(struct GBA*); + +CXX_GUARD_END #endif
@@ -3,7 +3,12 @@ *
* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef GBA_VBM_H +#define GBA_VBM_H + #include "util/common.h" + +CXX_GUARD_START #include "gba/rr/rr.h"@@ -19,3 +24,7 @@
void GBAVBMContextCreate(struct GBAVBMContext*); bool GBAVBMSetStream(struct GBAVBMContext*, struct VFile*); + +CXX_GUARD_END + +#endif
@@ -8,6 +8,8 @@ #define GBA_SAVEDATA_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" mLOG_DECLARE_CATEGORY(GBA_SAVE);@@ -118,5 +120,7 @@
struct GBASerializedState; void GBASavedataSerialize(const struct GBASavedata* savedata, struct GBASerializedState* state); void GBASavedataDeserialize(struct GBASavedata* savedata, const struct GBASerializedState* state); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_SERIALIZE_H
#include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "gba/gba.h" #include "gb/serialize.h"@@ -332,5 +334,7 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state);
struct GBASerializedState* GBAAllocateState(void); void GBADeallocateState(struct GBASerializedState* state); + +CXX_GUARD_END #endif
@@ -8,10 +8,14 @@ #define GBA_SHARKPORT_H
#include "util/common.h" +CXX_GUARD_START + struct GBA; struct VFile; bool GBASavedataImportSharkPort(struct GBA* gba, struct VFile* vf, bool testChecksum); bool GBASavedataExportSharkPort(const struct GBA* gba, struct VFile* vf); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_SIO_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "gba/interface.h"@@ -77,5 +79,7 @@
void GBASIOWriteRCNT(struct GBASIO* sio, uint16_t value); void GBASIOWriteSIOCNT(struct GBASIO* sio, uint16_t value); uint16_t GBASIOWriteRegister(struct GBASIO* sio, uint32_t address, uint16_t value); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_SIO_LOCKSTEP_H
#include "util/common.h" +CXX_GUARD_START + #include "core/lockstep.h" #include "core/timing.h" #include "gba/sio.h"@@ -45,5 +47,7 @@ void GBASIOLockstepNodeCreate(struct GBASIOLockstepNode*);
bool GBASIOLockstepAttachNode(struct GBASIOLockstep*, struct GBASIOLockstepNode*); void GBASIOLockstepDetachNode(struct GBASIOLockstep*, struct GBASIOLockstepNode*); + +CXX_GUARD_END #endif
@@ -7,6 +7,9 @@ #ifndef GBA_TIMER_H
#define GBA_TIMER_H #include "util/common.h" + +CXX_GUARD_START + #include "core/timing.h" DECL_BITFIELD(GBATimerFlags, uint32_t);@@ -29,5 +32,7 @@ void GBATimerInit(struct GBA* gba);
void GBATimerUpdateRegister(struct GBA* gba, int timer); void GBATimerWriteTMCNT_LO(struct GBA* gba, int timer, uint16_t value); void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t value); + +CXX_GUARD_END #endif
@@ -11,6 +11,8 @@ #define GBA_VFAME_H
#include "util/common.h" +CXX_GUARD_START + enum GBAVFameCartType { VFAME_NO = 0, VFAME_STANDARD = 1,@@ -30,5 +32,7 @@ void GBAVFameDetect(struct GBAVFameCart* cart, uint32_t* rom, size_t romSize);
void GBAVFameSramWrite(struct GBAVFameCart* cart, uint32_t address, uint8_t value, uint8_t* sramData); uint32_t GBAVFameModifyRomAddress(struct GBAVFameCart* cart, uint32_t address, size_t romSize); uint32_t GBAVFameGetPatternValue(uint32_t address, int bits); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GBA_VIDEO_H
#include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "core/timing.h" #include "gba/memory.h"@@ -198,5 +200,7 @@ void GBAVideoSerialize(const struct GBAVideo* video, struct GBASerializedState* state);
void GBAVideoDeserialize(struct GBAVideo* video, const struct GBASerializedState* state); extern const int GBAVideoObjSizes[16][2]; + +CXX_GUARD_END #endif
@@ -8,7 +8,11 @@ #define LR35902_CLI_DEBUGGER_H
#include "util/common.h" +CXX_GUARD_START + struct CLIDebuggerSystem; void LR35902CLIDebuggerCreate(struct CLIDebuggerSystem* debugger); + +CXX_GUARD_END #endif
@@ -3,6 +3,13 @@ *
* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef LR35902_DEBUGGER_H +#define LR35902_DEBUGGER_H + +#include "util/common.h" + +CXX_GUARD_START + #include "debugger/debugger.h" struct LR35902DebugBreakpoint {@@ -28,3 +35,7 @@ struct LR35902DebugWatchpointList watchpoints;
}; struct mDebuggerPlatform* LR35902DebuggerPlatformCreate(void); + +CXX_GUARD_END + +#endif
@@ -8,9 +8,13 @@ #define ISA_LR35902_H
#include "util/common.h" +CXX_GUARD_START + struct LR35902Core; typedef void (*LR35902Instruction)(struct LR35902Core*); extern const LR35902Instruction _lr35902InstructionTable[0x100]; + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define LR35902_H
#include "util/common.h" +CXX_GUARD_START + #include "core/cpu.h" #include "lr35902/isa-lr35902.h"@@ -166,5 +168,7 @@ void LR35902RaiseIRQ(struct LR35902Core* cpu, uint8_t vector);
void LR35902Tick(struct LR35902Core* cpu); void LR35902Run(struct LR35902Core* cpu); + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GL_H #define GL_H +#include "util/common.h" + +CXX_GUARD_START + #ifdef USE_EPOXY #include <epoxy/gl.h> #elif defined(__APPLE__)@@ -26,5 +30,7 @@ GLuint tex;
}; void mGLContextCreate(struct mGLContext*); + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GLES2_H #define GLES2_H +#include "util/common.h" + +CXX_GUARD_START + #ifdef USE_EPOXY #include <epoxy/gl.h> #elif defined(BUILD_GL)@@ -93,5 +97,7 @@
struct VDir; bool mGLES2ShaderLoad(struct VideoShader*, struct VDir*); void mGLES2ShaderFree(struct VideoShader*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define POSIX_THREADING_H
#include "util/common.h" +CXX_GUARD_START + #include <pthread.h> #include <sys/time.h> #if defined(__FreeBSD__) || defined(__OpenBSD__)@@ -93,5 +95,7 @@ UNUSED(name);
return 0; #endif } + +CXX_GUARD_END #endif
@@ -5,9 +5,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "AboutScreen.h" -extern "C" { #include "core/version.h" -} #include <QFile> #include <QPixmap>
@@ -5,9 +5,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ArchiveInspector.h" -extern "C" { #include "util/vfs.h" -} using namespace QGBA;
@@ -9,7 +9,6 @@ #include "GBAApp.h"
#include <QFontDatabase> -extern "C" { #include "core/interface.h" #ifdef M_CORE_GBA #include "gba/memory.h"@@ -17,7 +16,6 @@ #endif
#ifdef M_CORE_GB #include "gb/memory.h" #endif -} using namespace QGBA;
@@ -10,9 +10,7 @@ #include "GameController.h"
#include "ui_AssetTile.h" -extern "C" { #include "core/tile-cache.h" -} namespace QGBA {
@@ -7,11 +7,9 @@ #include "AssetView.h"
#include <QTimer> -extern "C" { #ifdef M_CORE_GBA #include "gba/gba.h" #endif -} using namespace QGBA;
@@ -7,10 +7,8 @@ #include "AudioDevice.h"
#include "LogController.h" -extern "C" { #include "core/thread.h" #include "gba/audio.h" -} using namespace QGBA;
@@ -10,9 +10,7 @@ #include "LogController.h"
#include <QAudioOutput> -extern "C" { #include "core/thread.h" -} using namespace QGBA;
@@ -7,9 +7,7 @@ #include "AudioProcessorSDL.h"
#include "LogController.h" -extern "C" { #include "core/thread.h" -} using namespace QGBA;
@@ -9,9 +9,7 @@ #include "AudioProcessor.h"
#ifdef BUILD_SDL -extern "C" { #include "platform/sdl/sdl-audio.h" -} namespace QGBA {
@@ -10,9 +10,7 @@ #include "VFileDevice.h"
#include <QSet> -extern "C" { #include "core/cheats.h" -} using namespace QGBA;
@@ -11,7 +11,6 @@
#include <QClipboard> #include <QPushButton> -extern "C" { #include "core/cheats.h" #ifdef M_CORE_GBA #include "gba/cheats.h"@@ -19,7 +18,6 @@ #endif
#ifdef M_CORE_GB #include "gb/cheats.h" #endif -} using namespace QGBA;
@@ -11,9 +11,7 @@ #include <QAction>
#include <QDir> #include <QMenu> -extern "C" { #include "feature/commandline.h" -} using namespace QGBA;
@@ -15,11 +15,9 @@ #include <QVariant>
#include <functional> -extern "C" { #include "core/config.h" #include "util/configuration.h" #include "feature/commandline.h" -} class QAction; class QMenu;
@@ -9,9 +9,7 @@ #include "GameController.h"
#include <QMutexLocker> -extern "C" { #include "debugger/cli-debugger.h" -} using namespace QGBA;
@@ -12,9 +12,7 @@ #include <QMutex>
#include <QStringList> #include <QWaitCondition> -extern "C" { #include "debugger/cli-debugger.h" -} namespace QGBA {
@@ -8,13 +8,11 @@
#include "DisplayGL.h" #include "DisplayQt.h" -extern "C" { #ifdef M_CORE_GB #include "gb/video.h" #elif defined(M_CORE_GBA) #include "gba/video.h" #endif -} using namespace QGBA;
@@ -6,9 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef QGBA_DISPLAY #define QGBA_DISPLAY -extern "C" { #include "util/common.h" -} #include <QWidget>
@@ -8,7 +8,6 @@
#include <QApplication> #include <QResizeEvent> -extern "C" { #include "core/core.h" #include "core/thread.h" #ifdef BUILD_GL@@ -20,7 +19,6 @@ #ifdef _WIN32
#include <epoxy/wgl.h> #endif #endif -} using namespace QGBA;
@@ -22,9 +22,7 @@ #include <QQueue>
#include <QThread> #include <QTimer> -extern "C" { #include "platform/video-backend.h" -} namespace QGBA {
@@ -7,10 +7,8 @@ #include "DisplayQt.h"
#include <QPainter> -extern "C" { #include "core/core.h" #include "core/thread.h" -} using namespace QGBA;
@@ -16,12 +16,10 @@ #include <QFileOpenEvent>
#include <QIcon> #include <QTranslator> -extern "C" { #include "core/version.h" #include "feature/commandline.h" #include "util/nointro.h" #include "util/socket.h" -} using namespace QGBA;
@@ -14,10 +14,8 @@ #include "MultiplayerController.h"
struct NoIntroDB; -extern "C" { #include "core/log.h" #include "gba/sio.h" -} mLOG_DECLARE_CATEGORY(QT);
@@ -16,9 +16,7 @@ #include "InputController.h"
#include "KeyEditor.h" #ifdef BUILD_SDL -extern "C" { #include "platform/sdl/sdl-events.h" -} #endif using namespace QGBA;
@@ -11,9 +11,7 @@ #include <QPicture>
#include <QSet> #include <QWidget> -extern "C" { #include "gba/input.h" -} class QComboBox; class QTimer;
@@ -5,9 +5,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "GBAOverride.h" -extern "C" { #include "core/core.h" -} using namespace QGBA;
@@ -8,9 +8,7 @@ #define QGBA_GBA_OVERRIDE
#include "Override.h" -extern "C" { #include "gba/overrides.h" -} namespace QGBA {
@@ -5,11 +5,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "GBOverride.h" -extern "C" { #include "core/core.h" #include "gb/gb.h" #include "util/crc32.h" -} using namespace QGBA;
@@ -8,9 +8,7 @@ #define QGBA_GB_OVERRIDE
#include "Override.h" -extern "C" { #include "gb/overrides.h" -} namespace QGBA {
@@ -10,9 +10,7 @@ #include "DebuggerController.h"
#ifdef USE_GDB_STUB -extern "C" { #include "debugger/gdb-stub.h" -} namespace QGBA {
@@ -12,9 +12,7 @@ #include <QWidget>
#include "ui_GIFView.h" -extern "C" { #include "feature/imagemagick/imagemagick-gif-encoder.h" -} namespace QGBA {
@@ -17,7 +17,6 @@ #include <QThread>
#include <ctime> -extern "C" { #include "core/config.h" #include "core/directories.h" #include "core/serialize.h"@@ -34,7 +33,6 @@ #include "gb/gb.h"
#include "gb/renderers/tile-cache.h" #endif #include "util/vfs.h" -} using namespace QGBA; using namespace std;
@@ -15,7 +15,6 @@ #include <QTimer>
#include <memory> -extern "C" { #include "core/core.h" #include "core/thread.h" #include "gba/cheats.h"@@ -25,7 +24,6 @@ #include "gba/overrides.h"
#ifdef BUILD_SDL #include "platform/sdl/sdl-events.h" #endif -} struct Configuration; struct GBAAudio;
@@ -8,9 +8,7 @@ #define QGBA_GAMEPAD_AXIS_EVENT
#include <QEvent> -extern "C" { #include "gba/input.h" -} namespace QGBA {
@@ -8,9 +8,7 @@ #define QGBA_GAMEPAD_BUTTON_EVENT
#include <QEvent> -extern "C" { #include "gba/input.h" -} namespace QGBA {
@@ -12,9 +12,7 @@ #include <QFontDatabase>
#include <QGridLayout> #include <QSpinBox> -extern "C" { #include "gba/io.h" -} using namespace QGBA;
@@ -14,10 +14,8 @@ #include <QApplication>
#include <QTimer> #include <QWidget> -extern "C" { #include "core/interface.h" #include "util/configuration.h" -} using namespace QGBA;
@@ -14,13 +14,11 @@ #include <QVector>
class QTimer; -extern "C" { #include "gba/input.h" #ifdef BUILD_SDL #include "platform/sdl/sdl-events.h" #endif -} struct mRotationSource; struct mRumble;
@@ -8,9 +8,7 @@ #define QGBA_INPUT_PROFILE
#include "GamepadAxisEvent.h" -extern "C" { #include "gba/interface.h" -} namespace QGBA {
@@ -5,9 +5,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "LibraryModel.h" -extern "C" { #include "util/vfs.h" -} using namespace QGBA;
@@ -8,9 +8,7 @@ #define QGBA_LIBRARY_MODEL
#include <QAbstractItemModel> -extern "C" { #include "core/library.h" -} struct VDir;
@@ -14,13 +14,11 @@ #include <QDateTime>
#include <QKeyEvent> #include <QPainter> -extern "C" { #include "core/serialize.h" #ifdef M_CORE_GBA #include "gba/serialize.h" #endif #include "util/memory.h" -} using namespace QGBA;
@@ -11,9 +11,7 @@
#include <QObject> #include <QStringList> -extern "C" { #include "gba/gba.h" -} namespace QGBA {
@@ -19,9 +19,7 @@ #include <QScrollBar>
#include <QSlider> #include <QWheelEvent> -extern "C" { #include "core/core.h" -} using namespace QGBA;
@@ -13,9 +13,7 @@ #include <QStaticText>
#include <QVector> #include <memory> -extern "C" { #include "util/text-codec.h" -} struct mCore;
@@ -8,7 +8,6 @@ #include "MemoryView.h"
#include "GameController.h" -extern "C" { #include "core/core.h" #ifdef M_CORE_GBA #include "gba/memory.h"@@ -16,7 +15,6 @@ #endif
#ifdef M_CORE_GB #include "gb/memory.h" #endif -} using namespace QGBA;
@@ -9,9 +9,7 @@ #include <QPainter>
#include <QDebug> -extern "C" { #include "gba/video.h" -} using namespace QGBA;
@@ -7,14 +7,12 @@ #include "MultiplayerController.h"
#include "GameController.h" -extern "C" { #ifdef M_CORE_GBA #include "gba/gba.h" #endif #ifdef M_CORE_GB #include "gb/gb.h" #endif -} using namespace QGBA;
@@ -10,7 +10,6 @@ #include <QMutex>
#include <QList> #include <QObject> -extern "C" { #include "core/lockstep.h" #ifdef M_CORE_GBA #include "gba/sio/lockstep.h"@@ -18,7 +17,6 @@ #endif
#ifdef M_CORE_GB #include "gb/sio/lockstep.h" #endif -} namespace QGBA {
@@ -10,13 +10,11 @@
#include <QFontDatabase> #include <QTimer> -extern "C" { #include "gba/gba.h" #ifdef M_CORE_GB #include "gb/gb.h" #include "gb/io.h" #endif -} using namespace QGBA;
@@ -11,9 +11,7 @@ #include "GameController.h"
#include "ui_ObjView.h" -extern "C" { #include "core/tile-cache.h" -} namespace QGBA {
@@ -12,16 +12,12 @@ #include "GameController.h"
#ifdef M_CORE_GBA #include "GBAOverride.h" -extern "C" { #include "gba/gba.h" -} #endif #ifdef M_CORE_GB #include "GBOverride.h" -extern "C" { #include "gb/gb.h" -} #endif using namespace QGBA;
@@ -9,9 +9,7 @@
#include <QDialog> #ifdef M_CORE_GB -extern "C" { #include "gb/overrides.h" -} #endif #include "ui_OverrideView.h"
@@ -12,7 +12,6 @@
#include <QFileDialog> #include <QFontDatabase> -extern "C" { #include "core/core.h" #include "util/export.h" #ifdef M_CORE_GA@@ -22,7 +21,6 @@ #ifdef M_CORE_GB
#include "gb/gb.h" #endif #include "util/vfs.h" -} using namespace QGBA;
@@ -8,7 +8,6 @@
#include "GBAApp.h" #include "GameController.h" -extern "C" { #include "core/core.h" #ifdef M_CORE_GB #include "gb/gb.h"@@ -17,7 +16,6 @@ #ifdef M_CORE_GBA
#include "gba/gba.h" #endif #include "util/nointro.h" -} using namespace QGBA;
@@ -9,10 +9,8 @@ #include "GameController.h"
#include "GamepadAxisEvent.h" #include "InputController.h" -extern "C" { #include "core/core.h" #include "gba/gba.h" -} using namespace QGBA;
@@ -13,10 +13,8 @@ #include "GBAKeyEditor.h"
#include "InputController.h" #include "ShortcutView.h" -extern "C" { #include "core/serialize.h" #include "gba/gba.h" -} using namespace QGBA;
@@ -17,14 +17,12 @@ #include <QFormLayout>
#include <QGridLayout> #include <QSpinBox> -extern "C" { #include "core/version.h" #include "platform/video-backend.h" #if !defined(_WIN32) || defined(USE_EPOXY) #include "platform/opengl/gles2.h" #endif -} using namespace QGBA;
@@ -8,9 +8,7 @@
#include <QMouseEvent> #include <QPainter> -extern "C" { #include "core/interface.h" -} using namespace QGBA;
@@ -10,11 +10,9 @@
#include <QFontDatabase> #include <QTimer> -extern "C" { #ifdef M_CORE_GB #include "gb/gb.h" #endif -} using namespace QGBA;
@@ -11,9 +11,7 @@ #include "GameController.h"
#include "ui_TileView.h" -extern "C" { #include "core/tile-cache.h" -} namespace QGBA {
@@ -8,9 +8,7 @@ #define QGBA_VFILE_DEVICE
#include <QFileDevice> -extern "C" { #include "util/vfs.h" -} namespace QGBA {
@@ -13,9 +13,7 @@
#include <QMap> #ifdef M_CORE_GB -extern "C" { #include "gb/video.h" -} #endif using namespace QGBA;
@@ -12,9 +12,7 @@ #include <QWidget>
#include "ui_VideoView.h" -extern "C" { #include "feature/ffmpeg/ffmpeg-encoder.h" -} namespace QGBA {
@@ -42,7 +42,6 @@ #include "ShortcutController.h"
#include "TileView.h" #include "VideoView.h" -extern "C" { #include "core/version.h" #ifdef M_CORE_GB #include "gb/gb.h"@@ -50,7 +49,6 @@ #endif
#include "feature/commandline.h" #include "util/nointro.h" #include "util/vfs.h" -} using namespace QGBA;
@@ -13,10 +13,8 @@ #include <QTimer>
#include <functional> -extern "C" { #include "core/thread.h" #include "gba/gba.h" -} #include "InputController.h" #include "LoadSaveState.h"
@@ -5,9 +5,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef SDL_GL_COMMON_H #define SDL_GL_COMMON_H + +#include "util/common.h" + +CXX_GUARD_START + #include "main.h" void mSDLGLCommonSwap(struct VideoBackend* context); void mSDLGLCommonInit(struct mSDLRenderer* renderer); + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef SDL_MAIN_H #define SDL_MAIN_H +#include "util/common.h" + +CXX_GUARD_START + #ifdef M_CORE_GBA #include "gba/renderers/video-software.h" #endif@@ -106,4 +110,7 @@
#if defined(BUILD_GLES2) || defined(USE_EPOXY) void mSDLGLES2Create(struct mSDLRenderer* renderer); #endif + +CXX_GUARD_END + #endif
@@ -8,6 +8,8 @@ #define SDL_AUDIO_H
#include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include <SDL.h>@@ -35,5 +37,7 @@ bool mSDLInitAudio(struct mSDLAudio* context, struct mCoreThread*);
void mSDLDeinitAudio(struct mSDLAudio* context); void mSDLPauseAudio(struct mSDLAudio* context); void mSDLResumeAudio(struct mSDLAudio* context); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define SDL_EVENTS_H
#include "util/common.h" +CXX_GUARD_START + #include "core/interface.h" #include "core/log.h" #include "util/circle-buffer.h"@@ -109,5 +111,7 @@ void mSDLSuspendScreensaver(struct mSDLEvents*);
void mSDLResumeScreensaver(struct mSDLEvents*); void mSDLSetScreensaverSuspendable(struct mSDLEvents*, bool suspendable); #endif + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define VIDEO_BACKEND_H
#include "util/common.h" +CXX_GUARD_START + #ifdef _WIN32 #include <windows.h> typedef HWND WHandle;@@ -43,5 +45,7 @@ void* preprocessShader;
void* passes; size_t nPasses; }; + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define CIRCLE_BUFFER_H
#include "util/common.h" +CXX_GUARD_START + struct CircleBuffer { void* data; size_t capacity;@@ -29,5 +31,7 @@ int CircleBufferRead16(struct CircleBuffer* buffer, int16_t* value);
int CircleBufferRead32(struct CircleBuffer* buffer, int32_t* value); size_t CircleBufferRead(struct CircleBuffer* buffer, void* output, size_t length); size_t CircleBufferDump(const struct CircleBuffer* buffer, void* output, size_t length); + +CXX_GUARD_END #endif
@@ -6,6 +6,16 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef COMMON_H #define COMMON_H +#ifdef __cplusplus +#define CXX_GUARD_START extern "C" { +#define CXX_GUARD_END } +#else +#define CXX_GUARD_START +#define CXX_GUARD_END +#endif + +CXX_GUARD_START + #include <ctype.h> #include <fcntl.h> #include <inttypes.h>@@ -176,5 +186,7 @@ #define UNLIKELY(X) (!!(X))
#endif #define ROR(I, ROTATE) ((((uint32_t) (I)) >> ROTATE) | ((uint32_t) (I) << ((-ROTATE) & 31))) + +CXX_GUARD_END #endif
@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef CONFIGURATION_H #define CONFIGURATION_H +#include "util/common.h" + +CXX_GUARD_START + #include "util/table.h" struct VFile;@@ -34,5 +38,7 @@ bool ConfigurationWrite(const struct Configuration*, const char* path);
bool ConfigurationWriteSection(const struct Configuration*, const char* path, const char* section); void ConfigurationEnumerateSections(const struct Configuration* configuration, void (*handler)(const char* sectionName, void* user), void* user); + +CXX_GUARD_END #endif
@@ -8,10 +8,14 @@ #define CRC32_H
#include "util/common.h" +CXX_GUARD_START + struct VFile; uint32_t doCrc32(const void* buf, size_t size); uint32_t updateCrc32(uint32_t crc, const void* buf, size_t size); uint32_t fileCrc32(struct VFile* file, size_t endOffset); + +CXX_GUARD_END #endif
@@ -8,9 +8,13 @@ #define EXPORT_H
#include "util/common.h" +CXX_GUARD_START + struct VFile; bool exportPaletteRIFF(struct VFile* vf, size_t entries, const uint16_t* colors); bool exportPaletteACT(struct VFile* vf, size_t entries, const uint16_t* colors); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define FORMATTING_H
#include "util/common.h" +CXX_GUARD_START + #include "locale.h" #if defined(__APPLE__) || defined(__FreeBSD__)@@ -28,5 +30,7 @@
#ifndef HAVE_LOCALTIME_R struct tm* localtime_r(const time_t* timep, struct tm* result); #endif + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GUI_H
#include "util/common.h" +CXX_GUARD_START + #include "core/input.h" #include "util/vector.h"@@ -80,5 +82,7 @@ void GUIInit(struct GUIParams* params);
void GUIPollInput(struct GUIParams* params, uint32_t* newInput, uint32_t* heldInput); enum GUICursorState GUIPollCursor(struct GUIParams* params, unsigned* x, unsigned* y); void GUIInvalidateKeys(struct GUIParams* params); + +CXX_GUARD_END #endif
@@ -6,10 +6,16 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GUI_FILE_CHOOSER_H #define GUI_FILE_CHOOSER_H +#include "util/common.h" + +CXX_GUARD_START + #include "util/gui.h" struct VFile; bool GUISelectFile(struct GUIParams*, char* outPath, size_t outLen, bool (*filter)(struct VFile*)); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define GUI_FONT_H
#include "util/common.h" +CXX_GUARD_START + struct GUIFont; struct GUIFont* GUIFontCreate(void); void GUIFontDestroy(struct GUIFont*);@@ -83,5 +85,7 @@ void GUIFontPrint(const struct GUIFont*, int x, int y, enum GUIAlignment, uint32_t color, const char* text);
void GUIFontDrawGlyph(const struct GUIFont*, int x, int y, uint32_t color, uint32_t glyph); void GUIFontDrawIcon(const struct GUIFont*, int x, int y, enum GUIAlignment, enum GUIOrientation, uint32_t color, enum GUIIcon); void GUIFontDrawIconSize(const struct GUIFont* font, int x, int y, int w, int h, uint32_t color, enum GUIIcon icon); + +CXX_GUARD_END #endif
@@ -8,6 +8,10 @@ #define HASH_H
#include "util/common.h" +CXX_GUARD_START + uint32_t hash32(const void* key, int len, uint32_t seed); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define UTIL_MATH_H
#include "util/common.h" +CXX_GUARD_START + static inline uint32_t popcount32(unsigned bits) { bits = bits - ((bits >> 1) & 0x55555555); bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333);@@ -55,5 +57,7 @@ }
unsigned lz = clz32(bits - 1); return 1 << (32 - lz); } + +CXX_GUARD_END #endif
@@ -8,7 +8,11 @@ #define MEMORY_H
#include "util/common.h" +CXX_GUARD_START + void* anonymousMemoryMap(size_t size); void mappedMemoryFree(void* memory, size_t size); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define NOINTRO_H
#include "util/common.h" +CXX_GUARD_START + struct NoIntroGame { const char* name; const char* romName;@@ -25,5 +27,7 @@
struct NoIntroDB* NoIntroDBLoad(struct VFile* vf); void NoIntroDBDestroy(struct NoIntroDB* db); bool NoIntroDBLookupGameByCRC(const struct NoIntroDB* db, uint32_t crc32, struct NoIntroGame* game); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define PATCH_FAST_H
#include "util/common.h" +CXX_GUARD_START + #include "util/patch.h" #include "util/vector.h"@@ -30,5 +32,7 @@
void initPatchFast(struct PatchFast*); void deinitPatchFast(struct PatchFast*); bool diffPatchFast(struct PatchFast* patch, const void* restrict in, const void* restrict out, size_t size); + +CXX_GUARD_END #endif
@@ -8,8 +8,12 @@ #define PATCH_IPS_H
#include "util/common.h" +CXX_GUARD_START + struct Patch; bool loadPatchIPS(struct Patch* patch); + +CXX_GUARD_END #endif
@@ -8,8 +8,12 @@ #define PATCH_UPS_H
#include "util/common.h" +CXX_GUARD_START + struct Patch; bool loadPatchUPS(struct Patch* patch); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define PATCH_H
#include "util/common.h" +CXX_GUARD_START + struct VFile; struct Patch {@@ -18,5 +20,7 @@ bool (*applyPatch)(struct Patch* patch, const void* in, size_t inSize, void* out, size_t outSize);
}; bool loadPatch(struct VFile* vf, struct Patch* patch); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define PNG_IO_H
#include "util/common.h" +CXX_GUARD_START + #ifdef USE_PNG #include <png.h>@@ -36,5 +38,7 @@ bool PNGReadFooter(png_structp png, png_infop end);
void PNGReadClose(png_structp png, png_infop info, png_infop end); #endif + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define RING_FIFO_H
#include "util/common.h" +CXX_GUARD_START + struct RingFIFO { void* data; size_t capacity;@@ -21,5 +23,7 @@ size_t RingFIFOCapacity(const struct RingFIFO* buffer);
void RingFIFOClear(struct RingFIFO* buffer); size_t RingFIFOWrite(struct RingFIFO* buffer, const void* value, size_t length); size_t RingFIFORead(struct RingFIFO* buffer, void* output, size_t length); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define SOCKET_H
#include "util/common.h" +CXX_GUARD_START + #if defined(__cplusplus) && !defined(restrict) #define restrict __restrict__ #endif@@ -315,5 +317,7 @@ }
} return result; } + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define UTIL_STRING_H
#include "util/common.h" +CXX_GUARD_START + #ifndef HAVE_STRNDUP // This is sometimes a macro char* strndup(const char* start, size_t len);@@ -35,5 +37,7 @@ const char* hex8(const char* line, uint8_t* out);
const char* hex4(const char* line, uint8_t* out); void rtrim(char* string); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define TABLE_H
#include "util/common.h" +CXX_GUARD_START + struct TableList; struct Table {@@ -45,5 +47,7 @@ void HashTableClear(struct Table*);
void HashTableEnumerate(const struct Table*, void (handler(const char* key, void* value, void* user)), void* user); size_t HashTableSize(const struct Table*); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define TEXT_CODEC_H
#include "util/common.h" +CXX_GUARD_START + struct TextCodecNode; struct TextCodec { struct TextCodecNode* forwardRoot;@@ -28,5 +30,7 @@ void TextCodecStartEncode(struct TextCodec*, struct TextCodecIterator*);
ssize_t TextCodecAdvance(struct TextCodecIterator*, uint8_t byte, uint8_t* output, size_t outputLength); ssize_t TextCodecFinish(struct TextCodecIterator*, uint8_t* output, size_t outputLength); + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define THREADING_H
#include "util/common.h" +CXX_GUARD_START + #ifndef DISABLE_THREADING #ifdef USE_PTHREADS #include "platform/posix/threading.h"@@ -84,5 +86,7 @@ UNUSED(cond);
return 0; } #endif + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define VECTOR_H
#include "util/common.h" +CXX_GUARD_START + #define DECLARE_VECTOR(NAME, TYPE) \ struct NAME { \ TYPE* vector; \@@ -83,5 +85,7 @@ } \
size_t NAME ## Index(const struct NAME* vector, const TYPE* member) { \ return member - (const TYPE*) vector->vector; \ } \ + +CXX_GUARD_END #endif
@@ -8,6 +8,8 @@ #define VFS_H
#include "util/common.h" +CXX_GUARD_START + #ifdef _WIN32 #include <io.h> #include <windows.h>@@ -96,5 +98,7 @@ ssize_t VFileWrite32LE(struct VFile* vf, int32_t word);
ssize_t VFileWrite16LE(struct VFile* vf, int16_t hword); ssize_t VFileRead32LE(struct VFile* vf, void* word); ssize_t VFileRead16LE(struct VFile* vf, void* hword); + +CXX_GUARD_END #endif