From 2f1cb61d0197893cf0c3861e9130ff1aeaefb0b0 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Mon, 26 Dec 2016 21:01:55 -0800 Subject: [PATCH] All: Add C++ header guards --- CHANGES | 1 + src/arm/arm.h | 4 ++++ src/arm/debugger/cli-debugger.h | 4 ++++ src/arm/debugger/debugger.h | 11 +++++++++++ src/arm/debugger/memory-debugger.h | 4 ++++ src/arm/decoder.h | 6 ++++++ src/arm/isa-arm.h | 4 ++++ src/arm/isa-thumb.h | 4 ++++ src/core/cheats.h | 4 ++++ src/core/config.h | 4 ++++ src/core/core.h | 4 ++++ src/core/cpu.h | 4 ++++ src/core/directories.h | 4 ++++ src/core/input.h | 4 ++++ src/core/interface.h | 4 ++++ src/core/library.h | 4 ++++ src/core/lockstep.h | 4 ++++ src/core/log.h | 4 ++++ src/core/rewind.h | 4 ++++ src/core/serialize.h | 4 ++++ src/core/sync.h | 4 ++++ src/core/thread.h | 4 ++++ src/core/tile-cache.h | 4 ++++ src/core/timing.h | 4 ++++ src/debugger/cli-debugger.h | 4 ++++ src/debugger/debugger.h | 3 +++ src/debugger/gdb-stub.h | 4 ++++ src/debugger/parser.h | 5 +++++ src/feature/commandline.h | 4 ++++ src/feature/editline/cli-el-backend.h | 7 ++++++- src/feature/ffmpeg/ffmpeg-encoder.h | 6 ++++++ src/feature/gui/gui-config.h | 4 ++++ src/feature/gui/gui-runner.h | 4 ++++ src/feature/gui/remap.h | 4 ++++ src/feature/imagemagick/imagemagick-gif-encoder.c | 1 + src/feature/imagemagick/imagemagick-gif-encoder.h | 8 +++++++- src/gb/audio.h | 4 ++++ src/gb/cheats.h | 4 ++++ src/gb/core.h | 6 ++++++ src/gb/extra/cli.h | 6 ++++++ src/gb/gb.h | 4 ++++ src/gb/interface.h | 4 ++++ src/gb/io.h | 4 ++++ src/gb/mbc.h | 4 ++++ src/gb/memory.h | 4 ++++ src/gb/overrides.h | 4 ++++ src/gb/renderers/software.h | 4 ++++ src/gb/renderers/tile-cache.h | 4 ++++ src/gb/serialize.h | 4 ++++ src/gb/sio.h | 4 ++++ src/gb/sio/lockstep.h | 4 ++++ src/gb/timer.h | 4 ++++ src/gb/video.h | 4 ++++ src/gba/audio.h | 4 ++++ src/gba/bios.h | 4 ++++ src/gba/cheats.h | 4 ++++ src/gba/cheats/gameshark.h | 6 ++++++ src/gba/cheats/parv3.h | 6 ++++++ src/gba/core.h | 6 ++++++ src/gba/dma.h | 4 ++++ src/gba/extra/cli.h | 6 ++++++ src/gba/gba.h | 4 ++++ src/gba/hardware.h | 4 ++++ src/gba/hle-bios.h | 4 ++++ src/gba/input.h | 6 ++++++ src/gba/interface.h | 4 ++++ src/gba/io.h | 4 ++++ src/gba/memory.h | 4 ++++ src/gba/overrides.h | 4 ++++ src/gba/renderers/thread-proxy.h | 6 ++++++ src/gba/renderers/tile-cache.h | 4 ++++ src/gba/renderers/video-software.h | 4 ++++ src/gba/rr/mgm.h | 4 ++++ src/gba/rr/rr.h | 4 ++++ src/gba/rr/vbm.h | 9 +++++++++ src/gba/savedata.h | 4 ++++ src/gba/serialize.h | 4 ++++ src/gba/sharkport.h | 4 ++++ src/gba/sio.h | 4 ++++ src/gba/sio/lockstep.h | 4 ++++ src/gba/timer.h | 5 +++++ src/gba/vfame.h | 4 ++++ src/gba/video.h | 4 ++++ src/lr35902/debugger/cli-debugger.h | 4 ++++ src/lr35902/debugger/debugger.h | 11 +++++++++++ src/lr35902/isa-lr35902.h | 4 ++++ src/lr35902/lr35902.h | 4 ++++ src/platform/opengl/gl.h | 6 ++++++ src/platform/opengl/gles2.h | 6 ++++++ src/platform/posix/threading.h | 4 ++++ src/platform/qt/AboutScreen.cpp | 2 -- src/platform/qt/ArchiveInspector.cpp | 2 -- src/platform/qt/AssetTile.cpp | 2 -- src/platform/qt/AssetTile.h | 2 -- src/platform/qt/AssetView.cpp | 2 -- src/platform/qt/AudioDevice.cpp | 2 -- src/platform/qt/AudioProcessorQt.cpp | 2 -- src/platform/qt/AudioProcessorSDL.cpp | 2 -- src/platform/qt/AudioProcessorSDL.h | 2 -- src/platform/qt/CheatsModel.cpp | 2 -- src/platform/qt/CheatsView.cpp | 2 -- src/platform/qt/ConfigController.cpp | 2 -- src/platform/qt/ConfigController.h | 2 -- src/platform/qt/DebuggerConsoleController.cpp | 2 -- src/platform/qt/DebuggerConsoleController.h | 2 -- src/platform/qt/Display.cpp | 2 -- src/platform/qt/Display.h | 2 -- src/platform/qt/DisplayGL.cpp | 2 -- src/platform/qt/DisplayGL.h | 2 -- src/platform/qt/DisplayQt.cpp | 2 -- src/platform/qt/GBAApp.cpp | 2 -- src/platform/qt/GBAApp.h | 2 -- src/platform/qt/GBAKeyEditor.cpp | 2 -- src/platform/qt/GBAKeyEditor.h | 2 -- src/platform/qt/GBAOverride.cpp | 2 -- src/platform/qt/GBAOverride.h | 2 -- src/platform/qt/GBOverride.cpp | 2 -- src/platform/qt/GBOverride.h | 2 -- src/platform/qt/GDBController.h | 2 -- src/platform/qt/GIFView.h | 2 -- src/platform/qt/GameController.cpp | 2 -- src/platform/qt/GameController.h | 2 -- src/platform/qt/GamepadAxisEvent.h | 2 -- src/platform/qt/GamepadButtonEvent.h | 2 -- src/platform/qt/IOViewer.cpp | 2 -- src/platform/qt/InputController.cpp | 2 -- src/platform/qt/InputController.h | 2 -- src/platform/qt/InputProfile.h | 2 -- src/platform/qt/LibraryModel.cpp | 2 -- src/platform/qt/LibraryModel.h | 2 -- src/platform/qt/LoadSaveState.cpp | 2 -- src/platform/qt/LogController.h | 2 -- src/platform/qt/MemoryModel.cpp | 2 -- src/platform/qt/MemoryModel.h | 2 -- src/platform/qt/MemoryView.cpp | 2 -- src/platform/qt/MessagePainter.cpp | 2 -- src/platform/qt/MultiplayerController.cpp | 2 -- src/platform/qt/MultiplayerController.h | 2 -- src/platform/qt/ObjView.cpp | 2 -- src/platform/qt/ObjView.h | 2 -- src/platform/qt/OverrideView.cpp | 4 ---- src/platform/qt/OverrideView.h | 2 -- src/platform/qt/PaletteView.cpp | 2 -- src/platform/qt/ROMInfo.cpp | 2 -- src/platform/qt/SensorView.cpp | 2 -- src/platform/qt/SettingsView.cpp | 2 -- src/platform/qt/ShaderSelector.cpp | 2 -- src/platform/qt/Swatch.cpp | 2 -- src/platform/qt/TileView.cpp | 2 -- src/platform/qt/TileView.h | 2 -- src/platform/qt/VFileDevice.h | 2 -- src/platform/qt/VideoView.cpp | 2 -- src/platform/qt/VideoView.h | 2 -- src/platform/qt/Window.cpp | 2 -- src/platform/qt/Window.h | 2 -- src/platform/sdl/gl-common.h | 7 +++++++ src/platform/sdl/main.h | 7 +++++++ src/platform/sdl/sdl-audio.h | 4 ++++ src/platform/sdl/sdl-events.h | 4 ++++ src/platform/video-backend.h | 4 ++++ src/util/circle-buffer.h | 4 ++++ src/util/common.h | 12 ++++++++++++ src/util/configuration.h | 6 ++++++ src/util/crc32.h | 4 ++++ src/util/export.h | 4 ++++ src/util/formatting.h | 4 ++++ src/util/gui.h | 4 ++++ src/util/gui/file-select.h | 6 ++++++ src/util/gui/font.h | 4 ++++ src/util/gui/menu.h | 6 ++++++ src/util/hash.h | 4 ++++ src/util/math.h | 4 ++++ src/util/memory.h | 4 ++++ src/util/nointro.h | 4 ++++ src/util/patch-fast.h | 4 ++++ src/util/patch-ips.h | 4 ++++ src/util/patch-ups.h | 4 ++++ src/util/patch.h | 4 ++++ src/util/png-io.h | 4 ++++ src/util/ring-fifo.h | 4 ++++ src/util/socket.h | 4 ++++ src/util/string.h | 4 ++++ src/util/table.h | 4 ++++ src/util/text-codec.h | 4 ++++ src/util/threading.h | 4 ++++ src/util/vector.h | 4 ++++ src/util/vfs.h | 4 ++++ 187 files changed, 551 insertions(+), 134 deletions(-) diff --git a/CHANGES b/CHANGES index 151863e1c..ef9a32039 100644 --- a/CHANGES +++ b/CHANGES @@ -69,6 +69,7 @@ Misc: - GB Memory: Reset ROM bank when loading a ROM - GBA DMA: Refactor DMA out of memory.c - GBA DMA: Move DMAs to using absolute timing + - All: Add C++ header guards 0.5.1: (2016-10-05) Bugfixes: diff --git a/src/arm/arm.h b/src/arm/arm.h index 947cedf15..b8ddad47a 100644 --- a/src/arm/arm.h +++ b/src/arm/arm.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/cpu.h" enum { @@ -175,4 +177,6 @@ void ARMRun(struct ARMCore* cpu); void ARMRunLoop(struct ARMCore* cpu); void ARMRunFake(struct ARMCore* cpu, uint32_t opcode); +CXX_GUARD_END + #endif diff --git a/src/arm/debugger/cli-debugger.h b/src/arm/debugger/cli-debugger.h index e0e26b79f..c4e6bff6e 100644 --- a/src/arm/debugger/cli-debugger.h +++ b/src/arm/debugger/cli-debugger.h @@ -8,7 +8,11 @@ #include "util/common.h" +CXX_GUARD_START + struct CLIDebuggerSystem; void ARMCLIDebuggerCreate(struct CLIDebuggerSystem* debugger); +CXX_GUARD_END + #endif diff --git a/src/arm/debugger/debugger.h b/src/arm/debugger/debugger.h index aaedfc0fc..105702ccb 100644 --- a/src/arm/debugger/debugger.h +++ b/src/arm/debugger/debugger.h @@ -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 ARMDebugger { 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 diff --git a/src/arm/debugger/memory-debugger.h b/src/arm/debugger/memory-debugger.h index 58a717617..b27dec8d8 100644 --- a/src/arm/debugger/memory-debugger.h +++ b/src/arm/debugger/memory-debugger.h @@ -8,9 +8,13 @@ #include "util/common.h" +CXX_GUARD_START + struct ARMDebugger; void ARMDebuggerInstallMemoryShim(struct ARMDebugger* debugger); void ARMDebuggerRemoveMemoryShim(struct ARMDebugger* debugger); +CXX_GUARD_END + #endif diff --git a/src/arm/decoder.h b/src/arm/decoder.h index 6ca478046..eabd30272 100644 --- a/src/arm/decoder.h +++ b/src/arm/decoder.h @@ -6,6 +6,10 @@ #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 @@ -214,4 +218,6 @@ bool ARMDecodeThumbCombine(struct ARMInstructionInfo* info1, struct ARMInstructi struct ARMInstructionInfo* out); int ARMDisassemble(struct ARMInstructionInfo* info, uint32_t pc, char* buffer, int blen); +CXX_GUARD_END + #endif diff --git a/src/arm/isa-arm.h b/src/arm/isa-arm.h index f4694bead..7f3063171 100644 --- a/src/arm/isa-arm.h +++ b/src/arm/isa-arm.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #define ARM_PREFETCH_CYCLES (1 + cpu->memory.activeSeqCycles32) struct ARMCore; @@ -15,4 +17,6 @@ struct ARMCore; typedef void (*ARMInstruction)(struct ARMCore*, uint32_t opcode); extern const ARMInstruction _armTable[0x1000]; +CXX_GUARD_END + #endif diff --git a/src/arm/isa-thumb.h b/src/arm/isa-thumb.h index dd018441e..71ddd06ed 100644 --- a/src/arm/isa-thumb.h +++ b/src/arm/isa-thumb.h @@ -8,9 +8,13 @@ #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 diff --git a/src/core/cheats.h b/src/core/cheats.h index 1cc3dedc6..774dbede5 100644 --- a/src/core/cheats.h +++ b/src/core/cheats.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/cpu.h" #include "core/log.h" #include "util/vector.h" @@ -100,4 +102,6 @@ bool mCheatSaveFile(struct mCheatDevice*, struct VFile*); void mCheatRefresh(struct mCheatDevice*, struct mCheatSet*); +CXX_GUARD_END + #endif diff --git a/src/core/config.h b/src/core/config.h index 806fadde3..d76646c35 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "util/configuration.h" struct mCoreConfig { @@ -91,4 +93,6 @@ const struct Configuration* mCoreConfigGetOverridesConst(const struct mCoreConfi void mCoreConfigFreeOpts(struct mCoreOptions* opts); +CXX_GUARD_END + #endif diff --git a/src/core/core.h b/src/core/core.h index 106275202..f5592adc8 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/config.h" #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 #include "core/directories.h" @@ -159,4 +161,6 @@ 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 diff --git a/src/core/cpu.h b/src/core/cpu.h index e55f5a19f..079e9eb5c 100644 --- a/src/core/cpu.h +++ b/src/core/cpu.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + enum mCPUComponentType { CPU_COMPONENT_DEBUGGER, CPU_COMPONENT_CHEAT_DEVICE, @@ -20,4 +22,6 @@ struct mCPUComponent { void (*deinit)(struct mCPUComponent* component); }; +CXX_GUARD_END + #endif diff --git a/src/core/directories.h b/src/core/directories.h index 55f3df513..b56787a9a 100644 --- a/src/core/directories.h +++ b/src/core/directories.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 struct VDir; @@ -34,4 +36,6 @@ struct mCoreOptions; void mDirectorySetMapOptions(struct mDirectorySet* dirs, const struct mCoreOptions* opts); #endif +CXX_GUARD_END + #endif diff --git a/src/core/input.h b/src/core/input.h index 4a7fc5a7b..01d55f26b 100644 --- a/src/core/input.h +++ b/src/core/input.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct Configuration; struct mInputPlatformInfo { @@ -60,4 +62,6 @@ const char* mInputGetCustomValue(const struct Configuration* config, const char* void mInputSetCustomValue(struct Configuration* config, const char* platformName, uint32_t type, const char* key, const char* value, const char* profile); +CXX_GUARD_END + #endif diff --git a/src/core/interface.h b/src/core/interface.h index 3d35cb059..805f555f1 100644 --- a/src/core/interface.h +++ b/src/core/interface.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct mCore; #ifdef COLOR_16_BIT @@ -84,4 +86,6 @@ struct mRumble { void (*setRumble)(struct mRumble*, int enable); }; +CXX_GUARD_END + #endif diff --git a/src/core/library.h b/src/core/library.h index cb9f2a48c..8a4fa68ff 100644 --- a/src/core/library.h +++ b/src/core/library.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "util/vector.h" @@ -34,4 +36,6 @@ 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 diff --git a/src/core/lockstep.h b/src/core/lockstep.h index cea0fd1d8..be9e939b7 100644 --- a/src/core/lockstep.h +++ b/src/core/lockstep.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + enum mLockstepPhase { TRANSFER_IDLE = 0, TRANSFER_STARTING, @@ -34,4 +36,6 @@ struct mLockstep { void mLockstepInit(struct mLockstep*); +CXX_GUARD_END + #endif diff --git a/src/core/log.h b/src/core/log.h index 03fb31ee9..680638324 100644 --- a/src/core/log.h +++ b/src/core/log.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + enum mLogLevel { mLOG_FATAL = 0x01, mLOG_ERROR = 0x02, @@ -58,4 +60,6 @@ static inline void mLog(int category, enum mLogLevel level, const char* format, mLOG_DECLARE_CATEGORY(STATUS) +CXX_GUARD_END + #endif diff --git a/src/core/rewind.h b/src/core/rewind.h index 50844c545..3d951ae1a 100644 --- a/src/core/rewind.h +++ b/src/core/rewind.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "util/vector.h" DECLARE_VECTOR(mCoreRewindPatches, struct PatchFast); @@ -28,4 +30,6 @@ struct mCore; void mCoreRewindAppend(struct mCoreRewindContext*, struct mCore*); bool mCoreRewindRestore(struct mCoreRewindContext*, struct mCore*); +CXX_GUARD_END + #endif diff --git a/src/core/serialize.h b/src/core/serialize.h index d639aaae4..b901fbe40 100644 --- a/src/core/serialize.h +++ b/src/core/serialize.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + enum mStateExtdataTag { EXTDATA_NONE = 0, EXTDATA_SCREENSHOT = 1, @@ -44,4 +46,6 @@ 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 diff --git a/src/core/sync.h b/src/core/sync.h index 8932951aa..19add7e76 100644 --- a/src/core/sync.h +++ b/src/core/sync.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "util/threading.h" struct mCoreSync { @@ -36,4 +38,6 @@ void mCoreSyncLockAudio(struct mCoreSync* sync); void mCoreSyncUnlockAudio(struct mCoreSync* sync); void mCoreSyncConsumeAudio(struct mCoreSync* sync); +CXX_GUARD_END + #endif diff --git a/src/core/thread.h b/src/core/thread.h index b28569212..07ec8b9a0 100644 --- a/src/core/thread.h +++ b/src/core/thread.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "core/rewind.h" #include "core/sync.h" @@ -97,4 +99,6 @@ void mCoreThreadSetRewinding(struct mCoreThread* threadContext, bool); struct mCoreThread* mCoreThreadGet(void); struct mLogger* mCoreThreadLogger(void); +CXX_GUARD_END + #endif diff --git a/src/core/tile-cache.h b/src/core/tile-cache.h index 052dca884..b1f780f55 100644 --- a/src/core/tile-cache.h +++ b/src/core/tile-cache.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + DECL_BITFIELD(mTileCacheConfiguration, uint32_t); DECL_BIT(mTileCacheConfiguration, ShouldStore, 0); @@ -57,4 +59,6 @@ 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 diff --git a/src/core/timing.h b/src/core/timing.h index ed99ff2e6..815215dd8 100644 --- a/src/core/timing.h +++ b/src/core/timing.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct mTiming; struct mTimingEvent { void* context; @@ -37,4 +39,6 @@ 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 diff --git a/src/debugger/cli-debugger.h b/src/debugger/cli-debugger.h index 98e19b5ab..c82a8b493 100644 --- a/src/debugger/cli-debugger.h +++ b/src/debugger/cli-debugger.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "debugger.h" struct CLIDebugger; @@ -86,4 +88,6 @@ void CLIDebuggerAttachBackend(struct CLIDebugger*, struct CLIDebuggerBackend*); bool CLIDebuggerTabComplete(struct CLIDebugger*, const char* token, bool initial, size_t len); +CXX_GUARD_END + #endif diff --git a/src/debugger/debugger.h b/src/debugger/debugger.h index a4ce367f6..cc564499d 100644 --- a/src/debugger/debugger.h +++ b/src/debugger/debugger.h @@ -8,6 +8,8 @@ #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 diff --git a/src/debugger/gdb-stub.h b/src/debugger/gdb-stub.h index 6e723e48e..84b086a60 100644 --- a/src/debugger/gdb-stub.h +++ b/src/debugger/gdb-stub.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "debugger/debugger.h" #include "util/socket.h" @@ -47,4 +49,6 @@ void GDBStubShutdown(struct GDBStub*); void GDBStubUpdate(struct GDBStub*); +CXX_GUARD_END + #endif diff --git a/src/debugger/parser.h b/src/debugger/parser.h index c68f08d9e..39ac6d262 100644 --- a/src/debugger/parser.h +++ b/src/debugger/parser.h @@ -7,6 +7,9 @@ #define PARSER_H #include "util/common.h" + +CXX_GUARD_START + #include "debugger.h" enum LexState { @@ -62,4 +65,6 @@ void parseLexedExpression(struct ParseTree* tree, struct LexVector* lv); void lexFree(struct LexVector* lv); void parseFree(struct ParseTree* tree); +CXX_GUARD_END + #endif diff --git a/src/feature/commandline.h b/src/feature/commandline.h index 9fbb64f79..0b672eb34 100644 --- a/src/feature/commandline.h +++ b/src/feature/commandline.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "debugger/debugger.h" struct mArguments { @@ -49,4 +51,6 @@ void version(const char* arg0); void initParserForGraphics(struct mSubParser* parser, struct mGraphicsOpts* opts); +CXX_GUARD_END + #endif diff --git a/src/feature/editline/cli-el-backend.h b/src/feature/editline/cli-el-backend.h index df3986e07..68fb32a1c 100644 --- a/src/feature/editline/cli-el-backend.h +++ b/src/feature/editline/cli-el-backend.h @@ -6,9 +6,12 @@ #ifndef CLI_EL_BACKEND_H #define CLI_EL_BACKEND_H -#include "debugger/cli-debugger.h" #include "util/common.h" +CXX_GUARD_START + +#include "debugger/cli-debugger.h" + #include struct CLIDebuggerEditLineBackend { @@ -20,4 +23,6 @@ struct CLIDebuggerEditLineBackend { struct CLIDebuggerBackend* CLIDebuggerEditLineBackendCreate(void); +CXX_GUARD_END + #endif diff --git a/src/feature/ffmpeg/ffmpeg-encoder.h b/src/feature/ffmpeg/ffmpeg-encoder.h index 6a8d9bf4a..b8017769f 100644 --- a/src/feature/ffmpeg/ffmpeg-encoder.h +++ b/src/feature/ffmpeg/ffmpeg-encoder.h @@ -6,6 +6,10 @@ #ifndef FFMPEG_ENCODER #define FFMPEG_ENCODER +#include "util/common.h" + +CXX_GUARD_START + #include "gba/gba.h" #include @@ -83,4 +87,6 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder*, const char* outfile); void FFmpegEncoderClose(struct FFmpegEncoder*); bool FFmpegEncoderIsOpen(struct FFmpegEncoder*); +CXX_GUARD_END + #endif diff --git a/src/feature/gui/gui-config.h b/src/feature/gui/gui-config.h index 0771f2133..539bd109e 100644 --- a/src/feature/gui/gui-config.h +++ b/src/feature/gui/gui-config.h @@ -8,8 +8,12 @@ #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 diff --git a/src/feature/gui/gui-runner.h b/src/feature/gui/gui-runner.h index 556c4f269..1293b1e97 100644 --- a/src/feature/gui/gui-runner.h +++ b/src/feature/gui/gui-runner.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/config.h" #include "feature/gui/remap.h" #include "gba/hardware.h" @@ -75,4 +77,6 @@ void mGUIDeinit(struct mGUIRunner*); void mGUIRun(struct mGUIRunner*, const char* path); void mGUIRunloop(struct mGUIRunner*); +CXX_GUARD_END + #endif diff --git a/src/feature/gui/remap.h b/src/feature/gui/remap.h index ab6a0e70c..de0cd6e8a 100644 --- a/src/feature/gui/remap.h +++ b/src/feature/gui/remap.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct GUIInputKeys { const char* name; uint32_t id; @@ -20,4 +22,6 @@ struct mInputMap; void mGUIRemapKeys(struct GUIParams*, struct mInputMap*, const struct GUIInputKeys*); +CXX_GUARD_END + #endif diff --git a/src/feature/imagemagick/imagemagick-gif-encoder.c b/src/feature/imagemagick/imagemagick-gif-encoder.c index 2eb4ad358..ccd8ea426 100644 --- a/src/feature/imagemagick/imagemagick-gif-encoder.c +++ b/src/feature/imagemagick/imagemagick-gif-encoder.c @@ -5,6 +5,7 @@ * 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" diff --git a/src/feature/imagemagick/imagemagick-gif-encoder.h b/src/feature/imagemagick/imagemagick-gif-encoder.h index 554813737..366c8f6b7 100644 --- a/src/feature/imagemagick/imagemagick-gif-encoder.h +++ b/src/feature/imagemagick/imagemagick-gif-encoder.h @@ -6,7 +6,11 @@ #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 @@ -33,4 +37,6 @@ bool ImageMagickGIFEncoderOpen(struct ImageMagickGIFEncoder*, const char* outfil bool ImageMagickGIFEncoderClose(struct ImageMagickGIFEncoder*); bool ImageMagickGIFEncoderIsOpen(struct ImageMagickGIFEncoder*); +CXX_GUARD_END + #endif diff --git a/src/gb/audio.h b/src/gb/audio.h index 4c38fcef8..bd47a72e9 100644 --- a/src/gb/audio.h +++ b/src/gb/audio.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/timing.h" #include "third-party/blip_buf/blip_buf.h" @@ -240,4 +242,6 @@ struct GBSerializedState; void GBAudioSerialize(const struct GBAudio* audio, struct GBSerializedState* state); void GBAudioDeserialize(struct GBAudio* audio, const struct GBSerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gb/cheats.h b/src/gb/cheats.h index 1e5b4da24..5b2f7e3a0 100644 --- a/src/gb/cheats.h +++ b/src/gb/cheats.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/cheats.h" #include "util/vector.h" @@ -36,4 +38,6 @@ struct GBCheatSet { struct mCheatDevice* GBCheatDeviceCreate(void); +CXX_GUARD_END + #endif diff --git a/src/gb/core.h b/src/gb/core.h index 10f7dc70d..5839b6709 100644 --- a/src/gb/core.h +++ b/src/gb/core.h @@ -6,7 +6,13 @@ #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 diff --git a/src/gb/extra/cli.h b/src/gb/extra/cli.h index 013843ce5..343ef1546 100644 --- a/src/gb/extra/cli.h +++ b/src/gb/extra/cli.h @@ -6,6 +6,10 @@ #ifndef GB_CLI_H #define GB_CLI_H +#include "util/common.h" + +CXX_GUARD_START + #include "debugger/cli-debugger.h" struct GBCLIDebugger { @@ -19,4 +23,6 @@ struct GBCLIDebugger { struct CLIDebuggerSystem* GBCLIDebuggerCreate(struct mCore*); +CXX_GUARD_END + #endif diff --git a/src/gb/gb.h b/src/gb/gb.h index dba27742a..f270e58bf 100644 --- a/src/gb/gb.h +++ b/src/gb/gb.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "core/timing.h" @@ -141,4 +143,6 @@ void GBGetGameCode(const struct GB* gba, char* out); void GBFrameEnded(struct GB* gb); +CXX_GUARD_END + #endif diff --git a/src/gb/interface.h b/src/gb/interface.h index 246b8f858..2764c2a9b 100644 --- a/src/gb/interface.h +++ b/src/gb/interface.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + enum GBModel { GB_MODEL_AUTODETECT = 0xFF, GB_MODEL_DMG = 0x00, @@ -32,4 +34,6 @@ enum GBMemoryBankControllerType { GB_MBC5_RUMBLE = 0x105 }; +CXX_GUARD_END + #endif diff --git a/src/gb/io.h b/src/gb/io.h index ffd6f47c9..756157565 100644 --- a/src/gb/io.h +++ b/src/gb/io.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" mLOG_DECLARE_CATEGORY(GB_IO); @@ -118,4 +120,6 @@ struct GBSerializedState; void GBIOSerialize(const struct GB* gb, struct GBSerializedState* state); void GBIODeserialize(struct GB* gb, const struct GBSerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gb/mbc.h b/src/gb/mbc.h index c750db707..b38b53096 100644 --- a/src/gb/mbc.h +++ b/src/gb/mbc.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" mLOG_DECLARE_CATEGORY(GB_MBC); @@ -37,4 +39,6 @@ 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 diff --git a/src/gb/memory.h b/src/gb/memory.h index cb3cf1b1d..1117bb4b5 100644 --- a/src/gb/memory.h +++ b/src/gb/memory.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "core/timing.h" #include "gb/interface.h" @@ -175,4 +177,6 @@ struct GBSerializedState; void GBMemorySerialize(const struct GB* gb, struct GBSerializedState* state); void GBMemoryDeserialize(struct GB* gb, const struct GBSerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gb/overrides.h b/src/gb/overrides.h index fc4f8f39a..1779aea16 100644 --- a/src/gb/overrides.h +++ b/src/gb/overrides.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "gb/interface.h" struct GBCartridgeOverride { @@ -24,4 +26,6 @@ struct GB; void GBOverrideApply(struct GB*, const struct GBCartridgeOverride*); void GBOverrideApplyDefaults(struct GB*); +CXX_GUARD_END + #endif diff --git a/src/gb/renderers/software.h b/src/gb/renderers/software.h index 6ea90a6e1..9f2b9e519 100644 --- a/src/gb/renderers/software.h +++ b/src/gb/renderers/software.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "gb/gb.h" #include "gb/video.h" @@ -36,4 +38,6 @@ struct GBVideoSoftwareRenderer { void GBVideoSoftwareRendererCreate(struct GBVideoSoftwareRenderer*); +CXX_GUARD_END + #endif diff --git a/src/gb/renderers/tile-cache.h b/src/gb/renderers/tile-cache.h index 630b9e8e9..7a96ec866 100644 --- a/src/gb/renderers/tile-cache.h +++ b/src/gb/renderers/tile-cache.h @@ -8,10 +8,14 @@ #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 diff --git a/src/gb/serialize.h b/src/gb/serialize.h index 3329141db..9819af85a 100644 --- a/src/gb/serialize.h +++ b/src/gb/serialize.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "gb/gb.h" @@ -370,4 +372,6 @@ struct GBSerializedState { bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state); void GBSerialize(struct GB* gb, struct GBSerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gb/sio.h b/src/gb/sio.h index e5dbe6bbd..e101f9c3f 100644 --- a/src/gb/sio.h +++ b/src/gb/sio.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "core/timing.h" @@ -53,4 +55,6 @@ 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 diff --git a/src/gb/sio/lockstep.h b/src/gb/sio/lockstep.h index a2a85457d..2b1b52815 100644 --- a/src/gb/sio/lockstep.h +++ b/src/gb/sio/lockstep.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/lockstep.h" #include "core/timing.h" #include "gb/sio.h" @@ -42,4 +44,6 @@ void GBSIOLockstepNodeCreate(struct GBSIOLockstepNode*); bool GBSIOLockstepAttachNode(struct GBSIOLockstep*, struct GBSIOLockstepNode*); void GBSIOLockstepDetachNode(struct GBSIOLockstep*, struct GBSIOLockstepNode*); +CXX_GUARD_END + #endif diff --git a/src/gb/timer.h b/src/gb/timer.h index 9ce673b56..0a6ebcea9 100644 --- a/src/gb/timer.h +++ b/src/gb/timer.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/timing.h" DECL_BITFIELD(GBRegisterTAC, uint8_t); @@ -38,4 +40,6 @@ struct GBSerializedState; void GBTimerSerialize(const struct GBTimer* timer, struct GBSerializedState* state); void GBTimerDeserialize(struct GBTimer* timer, const struct GBSerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gb/video.h b/src/gb/video.h index a2ddccdb3..0c7824478 100644 --- a/src/gb/video.h +++ b/src/gb/video.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/interface.h" #include "core/timing.h" #include "gb/interface.h" @@ -143,4 +145,6 @@ struct GBSerializedState; void GBVideoSerialize(const struct GBVideo* video, struct GBSerializedState* state); void GBVideoDeserialize(struct GBVideo* video, const struct GBSerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gba/audio.h b/src/gba/audio.h index 7f8175380..3a6d07348 100644 --- a/src/gba/audio.h +++ b/src/gba/audio.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "gb/audio.h" #include "util/circle-buffer.h" @@ -116,4 +118,6 @@ void GBAAudioDeserialize(struct GBAAudio* audio, const struct GBASerializedState float GBAAudioCalculateRatio(float inputSampleRate, float desiredFPS, float desiredSampleRatio); +CXX_GUARD_END + #endif diff --git a/src/gba/bios.h b/src/gba/bios.h index fdda39402..7d2bed194 100644 --- a/src/gba/bios.h +++ b/src/gba/bios.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "arm/arm.h" #include "core/log.h" @@ -20,4 +22,6 @@ 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 diff --git a/src/gba/cheats.h b/src/gba/cheats.h index 31f5acadc..6dcd01f53 100644 --- a/src/gba/cheats.h +++ b/src/gba/cheats.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "arm/arm.h" #include "core/cheats.h" @@ -174,4 +176,6 @@ bool GBACheatAddVBALine(struct GBACheatSet*, const char* line); int GBACheatAddressIsReal(uint32_t address); +CXX_GUARD_END + #endif diff --git a/src/gba/cheats/gameshark.h b/src/gba/cheats/gameshark.h index 09bdfe997..86736f492 100644 --- a/src/gba/cheats/gameshark.h +++ b/src/gba/cheats/gameshark.h @@ -6,6 +6,10 @@ #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]; @@ -16,4 +20,6 @@ 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 diff --git a/src/gba/cheats/parv3.h b/src/gba/cheats/parv3.h index 66a0e26fe..2723d673f 100644 --- a/src/gba/cheats/parv3.h +++ b/src/gba/cheats/parv3.h @@ -6,6 +6,10 @@ #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]; @@ -13,4 +17,6 @@ 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 diff --git a/src/gba/core.h b/src/gba/core.h index c68277c25..add75ede7 100644 --- a/src/gba/core.h +++ b/src/gba/core.h @@ -6,7 +6,13 @@ #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 diff --git a/src/gba/dma.h b/src/gba/dma.h index 405a9e554..984980c87 100644 --- a/src/gba/dma.h +++ b/src/gba/dma.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct GBA; void GBADMAInit(struct GBA* gba); void GBADMAReset(struct GBA* gba); @@ -23,4 +25,6 @@ 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 diff --git a/src/gba/extra/cli.h b/src/gba/extra/cli.h index 347f45437..e77f8439d 100644 --- a/src/gba/extra/cli.h +++ b/src/gba/extra/cli.h @@ -6,6 +6,10 @@ #ifndef GBA_CLI_H #define GBA_CLI_H +#include "util/common.h" + +CXX_GUARD_START + #include "debugger/cli-debugger.h" struct mCore; @@ -21,4 +25,6 @@ struct GBACLIDebugger { struct GBACLIDebugger* GBACLIDebuggerCreate(struct mCore*); +CXX_GUARD_END + #endif diff --git a/src/gba/gba.h b/src/gba/gba.h index cfcaa94e3..7adc8bd2b 100644 --- a/src/gba/gba.h +++ b/src/gba/gba.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "arm/arm.h" #include "core/log.h" #include "core/timing.h" @@ -175,4 +177,6 @@ void GBAGetGameTitle(const struct GBA* gba, char* out); void GBAFrameStarted(struct GBA* gba); void GBAFrameEnded(struct GBA* gba); +CXX_GUARD_END + #endif diff --git a/src/gba/hardware.h b/src/gba/hardware.h index bf7915c2c..0329fbf5e 100644 --- a/src/gba/hardware.h +++ b/src/gba/hardware.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "arm/macros.h" #include "core/log.h" #include "core/timing.h" @@ -144,4 +146,6 @@ struct GBASerializedState; void GBAHardwareSerialize(const struct GBACartridgeHardware* gpio, struct GBASerializedState* state); void GBAHardwareDeserialize(struct GBACartridgeHardware* gpio, const struct GBASerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gba/hle-bios.h b/src/gba/hle-bios.h index 6aa4cb92f..a696d7f6b 100644 --- a/src/gba/hle-bios.h +++ b/src/gba/hle-bios.h @@ -8,6 +8,10 @@ #include "util/common.h" +CXX_GUARD_START + extern const uint8_t hleBios[]; +CXX_GUARD_END + #endif diff --git a/src/gba/input.h b/src/gba/input.h index 5b3a418c1..cf2da1469 100644 --- a/src/gba/input.h +++ b/src/gba/input.h @@ -6,6 +6,10 @@ #ifndef GBA_INPUT_H #define GBA_INPUT_H +#include "util/common.h" + +CXX_GUARD_START + #include "core/input.h" extern const struct mInputPlatformInfo GBAInputInfo; @@ -25,4 +29,6 @@ enum GBAKey { GBA_KEY_NONE = -1 }; +CXX_GUARD_END + #endif diff --git a/src/gba/interface.h b/src/gba/interface.h index e0d27de98..2c9df6be3 100644 --- a/src/gba/interface.h +++ b/src/gba/interface.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/interface.h" enum GBASIOMode { @@ -42,4 +44,6 @@ struct GBASIODriver { uint16_t (*writeRegister)(struct GBASIODriver* driver, uint32_t address, uint16_t value); }; +CXX_GUARD_END + #endif diff --git a/src/gba/io.h b/src/gba/io.h index 5a73bce34..b7e6aaddd 100644 --- a/src/gba/io.h +++ b/src/gba/io.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "gba/gba.h" enum GBAIORegisters { @@ -173,4 +175,6 @@ struct GBASerializedState; void GBAIOSerialize(struct GBA* gba, struct GBASerializedState* state); void GBAIODeserialize(struct GBA* gba, const struct GBASerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gba/memory.h b/src/gba/memory.h index 08d89e9df..c9a81f4f3 100644 --- a/src/gba/memory.h +++ b/src/gba/memory.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "arm/arm.h" #include "core/timing.h" @@ -180,4 +182,6 @@ struct GBASerializedState; void GBAMemorySerialize(const struct GBAMemory* memory, struct GBASerializedState* state); void GBAMemoryDeserialize(struct GBAMemory* memory, const struct GBASerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gba/overrides.h b/src/gba/overrides.h index 58c005588..c86c0e728 100644 --- a/src/gba/overrides.h +++ b/src/gba/overrides.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "gba/savedata.h" #define IDLE_LOOP_NONE 0xFFFFFFFF @@ -28,4 +30,6 @@ struct GBA; void GBAOverrideApply(struct GBA*, const struct GBACartridgeOverride*); void GBAOverrideApplyDefaults(struct GBA*); +CXX_GUARD_END + #endif diff --git a/src/gba/renderers/thread-proxy.h b/src/gba/renderers/thread-proxy.h index 3f39176c4..2914f203b 100644 --- a/src/gba/renderers/thread-proxy.h +++ b/src/gba/renderers/thread-proxy.h @@ -6,6 +6,10 @@ #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" @@ -38,4 +42,6 @@ struct GBAVideoThreadProxyRenderer { void GBAVideoThreadProxyRendererCreate(struct GBAVideoThreadProxyRenderer* renderer, struct GBAVideoRenderer* backend); +CXX_GUARD_END + #endif diff --git a/src/gba/renderers/tile-cache.h b/src/gba/renderers/tile-cache.h index 04463a4ec..2afa25696 100644 --- a/src/gba/renderers/tile-cache.h +++ b/src/gba/renderers/tile-cache.h @@ -8,10 +8,14 @@ #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 diff --git a/src/gba/renderers/video-software.h b/src/gba/renderers/video-software.h index c6def6d60..96f0445df 100644 --- a/src/gba/renderers/video-software.h +++ b/src/gba/renderers/video-software.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "gba/video.h" @@ -162,4 +164,6 @@ struct GBAVideoSoftwareRenderer { void GBAVideoSoftwareRendererCreate(struct GBAVideoSoftwareRenderer* renderer); +CXX_GUARD_START + #endif diff --git a/src/gba/rr/mgm.h b/src/gba/rr/mgm.h index 9c494d50f..f45351a7b 100644 --- a/src/gba/rr/mgm.h +++ b/src/gba/rr/mgm.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "gba/rr/rr.h" struct GBA; @@ -80,4 +82,6 @@ void GBAMGMContextCreate(struct GBAMGMContext*); bool GBAMGMSetStream(struct GBAMGMContext* mgm, struct VDir* stream); bool GBAMGMCreateStream(struct GBAMGMContext* mgm, enum GBARRInitFrom initFrom); +CXX_GUARD_END + #endif diff --git a/src/gba/rr/rr.h b/src/gba/rr/rr.h index eb2964e1e..dcc7ea782 100644 --- a/src/gba/rr/rr.h +++ b/src/gba/rr/rr.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "gba/serialize.h" @@ -58,4 +60,6 @@ void GBARRDestroy(struct GBARRContext*); void GBARRInitRecord(struct GBA*); void GBARRInitPlay(struct GBA*); +CXX_GUARD_END + #endif diff --git a/src/gba/rr/vbm.h b/src/gba/rr/vbm.h index a314b9b0b..e38f83261 100644 --- a/src/gba/rr/vbm.h +++ b/src/gba/rr/vbm.h @@ -3,8 +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 GBA_VBM_H +#define GBA_VBM_H + #include "util/common.h" +CXX_GUARD_START + #include "gba/rr/rr.h" struct GBAVBMContext { @@ -19,3 +24,7 @@ struct GBAVBMContext { void GBAVBMContextCreate(struct GBAVBMContext*); bool GBAVBMSetStream(struct GBAVBMContext*, struct VFile*); + +CXX_GUARD_END + +#endif diff --git a/src/gba/savedata.h b/src/gba/savedata.h index 98feb52b4..bd2c8fc97 100644 --- a/src/gba/savedata.h +++ b/src/gba/savedata.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" mLOG_DECLARE_CATEGORY(GBA_SAVE); @@ -119,4 +121,6 @@ struct GBASerializedState; void GBASavedataSerialize(const struct GBASavedata* savedata, struct GBASerializedState* state); void GBASavedataDeserialize(struct GBASavedata* savedata, const struct GBASerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gba/serialize.h b/src/gba/serialize.h index 6db9eec1e..301eae0a9 100644 --- a/src/gba/serialize.h +++ b/src/gba/serialize.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "gba/gba.h" #include "gb/serialize.h" @@ -333,4 +335,6 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state); struct GBASerializedState* GBAAllocateState(void); void GBADeallocateState(struct GBASerializedState* state); +CXX_GUARD_END + #endif diff --git a/src/gba/sharkport.h b/src/gba/sharkport.h index 520ec246e..18bb0c64b 100644 --- a/src/gba/sharkport.h +++ b/src/gba/sharkport.h @@ -8,10 +8,14 @@ #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 diff --git a/src/gba/sio.h b/src/gba/sio.h index d9cfc83f0..f626979dd 100644 --- a/src/gba/sio.h +++ b/src/gba/sio.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include "gba/interface.h" @@ -78,4 +80,6 @@ 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 diff --git a/src/gba/sio/lockstep.h b/src/gba/sio/lockstep.h index 90391b61d..cecfbc733 100644 --- a/src/gba/sio/lockstep.h +++ b/src/gba/sio/lockstep.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/lockstep.h" #include "core/timing.h" #include "gba/sio.h" @@ -46,4 +48,6 @@ void GBASIOLockstepNodeCreate(struct GBASIOLockstepNode*); bool GBASIOLockstepAttachNode(struct GBASIOLockstep*, struct GBASIOLockstepNode*); void GBASIOLockstepDetachNode(struct GBASIOLockstep*, struct GBASIOLockstepNode*); +CXX_GUARD_END + #endif diff --git a/src/gba/timer.h b/src/gba/timer.h index 08314a4cf..1edce1c9e 100644 --- a/src/gba/timer.h +++ b/src/gba/timer.h @@ -7,6 +7,9 @@ #define GBA_TIMER_H #include "util/common.h" + +CXX_GUARD_START + #include "core/timing.h" DECL_BITFIELD(GBATimerFlags, uint32_t); @@ -30,4 +33,6 @@ 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 diff --git a/src/gba/vfame.h b/src/gba/vfame.h index d418f7a9b..fa226efa3 100644 --- a/src/gba/vfame.h +++ b/src/gba/vfame.h @@ -11,6 +11,8 @@ #include "util/common.h" +CXX_GUARD_START + enum GBAVFameCartType { VFAME_NO = 0, VFAME_STANDARD = 1, @@ -31,4 +33,6 @@ void GBAVFameSramWrite(struct GBAVFameCart* cart, uint32_t address, uint8_t valu uint32_t GBAVFameModifyRomAddress(struct GBAVFameCart* cart, uint32_t address, size_t romSize); uint32_t GBAVFameGetPatternValue(uint32_t address, int bits); +CXX_GUARD_END + #endif diff --git a/src/gba/video.h b/src/gba/video.h index da9f85848..01ef2b55e 100644 --- a/src/gba/video.h +++ b/src/gba/video.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/core.h" #include "core/timing.h" #include "gba/memory.h" @@ -199,4 +201,6 @@ void GBAVideoDeserialize(struct GBAVideo* video, const struct GBASerializedState extern const int GBAVideoObjSizes[16][2]; +CXX_GUARD_END + #endif diff --git a/src/lr35902/debugger/cli-debugger.h b/src/lr35902/debugger/cli-debugger.h index 5e6a8b1a3..a229f03cc 100644 --- a/src/lr35902/debugger/cli-debugger.h +++ b/src/lr35902/debugger/cli-debugger.h @@ -8,7 +8,11 @@ #include "util/common.h" +CXX_GUARD_START + struct CLIDebuggerSystem; void LR35902CLIDebuggerCreate(struct CLIDebuggerSystem* debugger); +CXX_GUARD_END + #endif diff --git a/src/lr35902/debugger/debugger.h b/src/lr35902/debugger/debugger.h index 53e022c30..9697f5fc5 100644 --- a/src/lr35902/debugger/debugger.h +++ b/src/lr35902/debugger/debugger.h @@ -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 LR35902Debugger { }; struct mDebuggerPlatform* LR35902DebuggerPlatformCreate(void); + +CXX_GUARD_END + +#endif diff --git a/src/lr35902/isa-lr35902.h b/src/lr35902/isa-lr35902.h index 0b73c8deb..60e278f4e 100644 --- a/src/lr35902/isa-lr35902.h +++ b/src/lr35902/isa-lr35902.h @@ -8,9 +8,13 @@ #include "util/common.h" +CXX_GUARD_START + struct LR35902Core; typedef void (*LR35902Instruction)(struct LR35902Core*); extern const LR35902Instruction _lr35902InstructionTable[0x100]; +CXX_GUARD_END + #endif diff --git a/src/lr35902/lr35902.h b/src/lr35902/lr35902.h index 84eddfb73..102f3941e 100644 --- a/src/lr35902/lr35902.h +++ b/src/lr35902/lr35902.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/cpu.h" #include "lr35902/isa-lr35902.h" @@ -167,4 +169,6 @@ void LR35902RaiseIRQ(struct LR35902Core* cpu, uint8_t vector); void LR35902Tick(struct LR35902Core* cpu); void LR35902Run(struct LR35902Core* cpu); +CXX_GUARD_END + #endif diff --git a/src/platform/opengl/gl.h b/src/platform/opengl/gl.h index 0370e2ea7..b5cda4ce7 100644 --- a/src/platform/opengl/gl.h +++ b/src/platform/opengl/gl.h @@ -6,6 +6,10 @@ #ifndef GL_H #define GL_H +#include "util/common.h" + +CXX_GUARD_START + #ifdef USE_EPOXY #include #elif defined(__APPLE__) @@ -27,4 +31,6 @@ struct mGLContext { void mGLContextCreate(struct mGLContext*); +CXX_GUARD_END + #endif diff --git a/src/platform/opengl/gles2.h b/src/platform/opengl/gles2.h index fabdebc14..03cbaf0ae 100644 --- a/src/platform/opengl/gles2.h +++ b/src/platform/opengl/gles2.h @@ -6,6 +6,10 @@ #ifndef GLES2_H #define GLES2_H +#include "util/common.h" + +CXX_GUARD_START + #ifdef USE_EPOXY #include #elif defined(BUILD_GL) @@ -94,4 +98,6 @@ struct VDir; bool mGLES2ShaderLoad(struct VideoShader*, struct VDir*); void mGLES2ShaderFree(struct VideoShader*); +CXX_GUARD_END + #endif diff --git a/src/platform/posix/threading.h b/src/platform/posix/threading.h index e13240f3e..0b958af54 100644 --- a/src/platform/posix/threading.h +++ b/src/platform/posix/threading.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include #include #if defined(__FreeBSD__) || defined(__OpenBSD__) @@ -94,4 +96,6 @@ static inline int ThreadSetName(const char* name) { #endif } +CXX_GUARD_END + #endif diff --git a/src/platform/qt/AboutScreen.cpp b/src/platform/qt/AboutScreen.cpp index e2743ce4e..895eaec74 100644 --- a/src/platform/qt/AboutScreen.cpp +++ b/src/platform/qt/AboutScreen.cpp @@ -5,9 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "AboutScreen.h" -extern "C" { #include "core/version.h" -} #include #include diff --git a/src/platform/qt/ArchiveInspector.cpp b/src/platform/qt/ArchiveInspector.cpp index 368b47a0d..11854ed95 100644 --- a/src/platform/qt/ArchiveInspector.cpp +++ b/src/platform/qt/ArchiveInspector.cpp @@ -5,9 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ArchiveInspector.h" -extern "C" { #include "util/vfs.h" -} using namespace QGBA; diff --git a/src/platform/qt/AssetTile.cpp b/src/platform/qt/AssetTile.cpp index e2e39b18d..7066a78bf 100644 --- a/src/platform/qt/AssetTile.cpp +++ b/src/platform/qt/AssetTile.cpp @@ -9,7 +9,6 @@ #include -extern "C" { #include "core/interface.h" #ifdef M_CORE_GBA #include "gba/memory.h" @@ -17,7 +16,6 @@ extern "C" { #ifdef M_CORE_GB #include "gb/memory.h" #endif -} using namespace QGBA; diff --git a/src/platform/qt/AssetTile.h b/src/platform/qt/AssetTile.h index b8cd6b53a..59800405a 100644 --- a/src/platform/qt/AssetTile.h +++ b/src/platform/qt/AssetTile.h @@ -10,9 +10,7 @@ #include "ui_AssetTile.h" -extern "C" { #include "core/tile-cache.h" -} namespace QGBA { diff --git a/src/platform/qt/AssetView.cpp b/src/platform/qt/AssetView.cpp index ebb337ed1..21420ae25 100644 --- a/src/platform/qt/AssetView.cpp +++ b/src/platform/qt/AssetView.cpp @@ -7,11 +7,9 @@ #include -extern "C" { #ifdef M_CORE_GBA #include "gba/gba.h" #endif -} using namespace QGBA; diff --git a/src/platform/qt/AudioDevice.cpp b/src/platform/qt/AudioDevice.cpp index 5f61dbb58..ae34d3221 100644 --- a/src/platform/qt/AudioDevice.cpp +++ b/src/platform/qt/AudioDevice.cpp @@ -7,10 +7,8 @@ #include "LogController.h" -extern "C" { #include "core/thread.h" #include "gba/audio.h" -} using namespace QGBA; diff --git a/src/platform/qt/AudioProcessorQt.cpp b/src/platform/qt/AudioProcessorQt.cpp index b999124bb..0f29105ec 100644 --- a/src/platform/qt/AudioProcessorQt.cpp +++ b/src/platform/qt/AudioProcessorQt.cpp @@ -10,9 +10,7 @@ #include -extern "C" { #include "core/thread.h" -} using namespace QGBA; diff --git a/src/platform/qt/AudioProcessorSDL.cpp b/src/platform/qt/AudioProcessorSDL.cpp index 08c1fe908..d869f8836 100644 --- a/src/platform/qt/AudioProcessorSDL.cpp +++ b/src/platform/qt/AudioProcessorSDL.cpp @@ -7,9 +7,7 @@ #include "LogController.h" -extern "C" { #include "core/thread.h" -} using namespace QGBA; diff --git a/src/platform/qt/AudioProcessorSDL.h b/src/platform/qt/AudioProcessorSDL.h index 2559ed49e..cd1d53957 100644 --- a/src/platform/qt/AudioProcessorSDL.h +++ b/src/platform/qt/AudioProcessorSDL.h @@ -9,9 +9,7 @@ #ifdef BUILD_SDL -extern "C" { #include "platform/sdl/sdl-audio.h" -} namespace QGBA { diff --git a/src/platform/qt/CheatsModel.cpp b/src/platform/qt/CheatsModel.cpp index 5d6b8cf65..d822b305f 100644 --- a/src/platform/qt/CheatsModel.cpp +++ b/src/platform/qt/CheatsModel.cpp @@ -10,9 +10,7 @@ #include -extern "C" { #include "core/cheats.h" -} using namespace QGBA; diff --git a/src/platform/qt/CheatsView.cpp b/src/platform/qt/CheatsView.cpp index a990ff25f..41799530a 100644 --- a/src/platform/qt/CheatsView.cpp +++ b/src/platform/qt/CheatsView.cpp @@ -11,7 +11,6 @@ #include #include -extern "C" { #include "core/cheats.h" #ifdef M_CORE_GBA #include "gba/cheats.h" @@ -19,7 +18,6 @@ extern "C" { #ifdef M_CORE_GB #include "gb/cheats.h" #endif -} using namespace QGBA; diff --git a/src/platform/qt/ConfigController.cpp b/src/platform/qt/ConfigController.cpp index 50462d7e8..d008fd756 100644 --- a/src/platform/qt/ConfigController.cpp +++ b/src/platform/qt/ConfigController.cpp @@ -11,9 +11,7 @@ #include #include -extern "C" { #include "feature/commandline.h" -} using namespace QGBA; diff --git a/src/platform/qt/ConfigController.h b/src/platform/qt/ConfigController.h index 4d8ab80a0..1953ccfbf 100644 --- a/src/platform/qt/ConfigController.h +++ b/src/platform/qt/ConfigController.h @@ -15,11 +15,9 @@ #include -extern "C" { #include "core/config.h" #include "util/configuration.h" #include "feature/commandline.h" -} class QAction; class QMenu; diff --git a/src/platform/qt/DebuggerConsoleController.cpp b/src/platform/qt/DebuggerConsoleController.cpp index 22cc9b3ff..0ac49fa0d 100644 --- a/src/platform/qt/DebuggerConsoleController.cpp +++ b/src/platform/qt/DebuggerConsoleController.cpp @@ -9,9 +9,7 @@ #include -extern "C" { #include "debugger/cli-debugger.h" -} using namespace QGBA; diff --git a/src/platform/qt/DebuggerConsoleController.h b/src/platform/qt/DebuggerConsoleController.h index 1128aabca..bac31e20b 100644 --- a/src/platform/qt/DebuggerConsoleController.h +++ b/src/platform/qt/DebuggerConsoleController.h @@ -12,9 +12,7 @@ #include #include -extern "C" { #include "debugger/cli-debugger.h" -} namespace QGBA { diff --git a/src/platform/qt/Display.cpp b/src/platform/qt/Display.cpp index a8af613ec..81526be51 100644 --- a/src/platform/qt/Display.cpp +++ b/src/platform/qt/Display.cpp @@ -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; diff --git a/src/platform/qt/Display.h b/src/platform/qt/Display.h index 841cd4278..66ce63110 100644 --- a/src/platform/qt/Display.h +++ b/src/platform/qt/Display.h @@ -6,9 +6,7 @@ #ifndef QGBA_DISPLAY #define QGBA_DISPLAY -extern "C" { #include "util/common.h" -} #include diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index c565b545e..f59474428 100644 --- a/src/platform/qt/DisplayGL.cpp +++ b/src/platform/qt/DisplayGL.cpp @@ -8,7 +8,6 @@ #include #include -extern "C" { #include "core/core.h" #include "core/thread.h" #ifdef BUILD_GL @@ -20,7 +19,6 @@ extern "C" { #include #endif #endif -} using namespace QGBA; diff --git a/src/platform/qt/DisplayGL.h b/src/platform/qt/DisplayGL.h index 5803dfd92..d89c26418 100644 --- a/src/platform/qt/DisplayGL.h +++ b/src/platform/qt/DisplayGL.h @@ -22,9 +22,7 @@ #include #include -extern "C" { #include "platform/video-backend.h" -} namespace QGBA { diff --git a/src/platform/qt/DisplayQt.cpp b/src/platform/qt/DisplayQt.cpp index b11294638..5dec87215 100644 --- a/src/platform/qt/DisplayQt.cpp +++ b/src/platform/qt/DisplayQt.cpp @@ -7,10 +7,8 @@ #include -extern "C" { #include "core/core.h" #include "core/thread.h" -} using namespace QGBA; diff --git a/src/platform/qt/GBAApp.cpp b/src/platform/qt/GBAApp.cpp index 377f9f67d..284145535 100644 --- a/src/platform/qt/GBAApp.cpp +++ b/src/platform/qt/GBAApp.cpp @@ -16,12 +16,10 @@ #include #include -extern "C" { #include "core/version.h" #include "feature/commandline.h" #include "util/nointro.h" #include "util/socket.h" -} using namespace QGBA; diff --git a/src/platform/qt/GBAApp.h b/src/platform/qt/GBAApp.h index ea7fa1267..988b55f11 100644 --- a/src/platform/qt/GBAApp.h +++ b/src/platform/qt/GBAApp.h @@ -14,10 +14,8 @@ struct NoIntroDB; -extern "C" { #include "core/log.h" #include "gba/sio.h" -} mLOG_DECLARE_CATEGORY(QT); diff --git a/src/platform/qt/GBAKeyEditor.cpp b/src/platform/qt/GBAKeyEditor.cpp index 0c33058ba..439b4294c 100644 --- a/src/platform/qt/GBAKeyEditor.cpp +++ b/src/platform/qt/GBAKeyEditor.cpp @@ -16,9 +16,7 @@ #include "KeyEditor.h" #ifdef BUILD_SDL -extern "C" { #include "platform/sdl/sdl-events.h" -} #endif using namespace QGBA; diff --git a/src/platform/qt/GBAKeyEditor.h b/src/platform/qt/GBAKeyEditor.h index bbd839063..a2b1391fc 100644 --- a/src/platform/qt/GBAKeyEditor.h +++ b/src/platform/qt/GBAKeyEditor.h @@ -11,9 +11,7 @@ #include #include -extern "C" { #include "gba/input.h" -} class QComboBox; class QTimer; diff --git a/src/platform/qt/GBAOverride.cpp b/src/platform/qt/GBAOverride.cpp index 1181162e2..bd165454a 100644 --- a/src/platform/qt/GBAOverride.cpp +++ b/src/platform/qt/GBAOverride.cpp @@ -5,9 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "GBAOverride.h" -extern "C" { #include "core/core.h" -} using namespace QGBA; diff --git a/src/platform/qt/GBAOverride.h b/src/platform/qt/GBAOverride.h index 71d67f90d..8f2042684 100644 --- a/src/platform/qt/GBAOverride.h +++ b/src/platform/qt/GBAOverride.h @@ -8,9 +8,7 @@ #include "Override.h" -extern "C" { #include "gba/overrides.h" -} namespace QGBA { diff --git a/src/platform/qt/GBOverride.cpp b/src/platform/qt/GBOverride.cpp index d04e90082..6aa4fd205 100644 --- a/src/platform/qt/GBOverride.cpp +++ b/src/platform/qt/GBOverride.cpp @@ -5,11 +5,9 @@ * 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; diff --git a/src/platform/qt/GBOverride.h b/src/platform/qt/GBOverride.h index 5fb7c057d..6d35618fc 100644 --- a/src/platform/qt/GBOverride.h +++ b/src/platform/qt/GBOverride.h @@ -8,9 +8,7 @@ #include "Override.h" -extern "C" { #include "gb/overrides.h" -} namespace QGBA { diff --git a/src/platform/qt/GDBController.h b/src/platform/qt/GDBController.h index fa295a074..aac3852b8 100644 --- a/src/platform/qt/GDBController.h +++ b/src/platform/qt/GDBController.h @@ -10,9 +10,7 @@ #ifdef USE_GDB_STUB -extern "C" { #include "debugger/gdb-stub.h" -} namespace QGBA { diff --git a/src/platform/qt/GIFView.h b/src/platform/qt/GIFView.h index ccfeddbc0..6641d8d94 100644 --- a/src/platform/qt/GIFView.h +++ b/src/platform/qt/GIFView.h @@ -12,9 +12,7 @@ #include "ui_GIFView.h" -extern "C" { #include "feature/imagemagick/imagemagick-gif-encoder.h" -} namespace QGBA { diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index eb5ef964c..d31ffa1a3 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -17,7 +17,6 @@ #include -extern "C" { #include "core/config.h" #include "core/directories.h" #include "core/serialize.h" @@ -34,7 +33,6 @@ extern "C" { #include "gb/renderers/tile-cache.h" #endif #include "util/vfs.h" -} using namespace QGBA; using namespace std; diff --git a/src/platform/qt/GameController.h b/src/platform/qt/GameController.h index 17282ad3a..30369c538 100644 --- a/src/platform/qt/GameController.h +++ b/src/platform/qt/GameController.h @@ -15,7 +15,6 @@ #include -extern "C" { #include "core/core.h" #include "core/thread.h" #include "gba/cheats.h" @@ -25,7 +24,6 @@ extern "C" { #ifdef BUILD_SDL #include "platform/sdl/sdl-events.h" #endif -} struct Configuration; struct GBAAudio; diff --git a/src/platform/qt/GamepadAxisEvent.h b/src/platform/qt/GamepadAxisEvent.h index 09a1b015d..6416041bd 100644 --- a/src/platform/qt/GamepadAxisEvent.h +++ b/src/platform/qt/GamepadAxisEvent.h @@ -8,9 +8,7 @@ #include -extern "C" { #include "gba/input.h" -} namespace QGBA { diff --git a/src/platform/qt/GamepadButtonEvent.h b/src/platform/qt/GamepadButtonEvent.h index 375a0e05f..82419191e 100644 --- a/src/platform/qt/GamepadButtonEvent.h +++ b/src/platform/qt/GamepadButtonEvent.h @@ -8,9 +8,7 @@ #include -extern "C" { #include "gba/input.h" -} namespace QGBA { diff --git a/src/platform/qt/IOViewer.cpp b/src/platform/qt/IOViewer.cpp index a69c6e731..b7b9bdd50 100644 --- a/src/platform/qt/IOViewer.cpp +++ b/src/platform/qt/IOViewer.cpp @@ -12,9 +12,7 @@ #include #include -extern "C" { #include "gba/io.h" -} using namespace QGBA; diff --git a/src/platform/qt/InputController.cpp b/src/platform/qt/InputController.cpp index 82a3ad1e4..c8a86f1cb 100644 --- a/src/platform/qt/InputController.cpp +++ b/src/platform/qt/InputController.cpp @@ -14,10 +14,8 @@ #include #include -extern "C" { #include "core/interface.h" #include "util/configuration.h" -} using namespace QGBA; diff --git a/src/platform/qt/InputController.h b/src/platform/qt/InputController.h index 307007867..ce33b8b28 100644 --- a/src/platform/qt/InputController.h +++ b/src/platform/qt/InputController.h @@ -14,13 +14,11 @@ class QTimer; -extern "C" { #include "gba/input.h" #ifdef BUILD_SDL #include "platform/sdl/sdl-events.h" #endif -} struct mRotationSource; struct mRumble; diff --git a/src/platform/qt/InputProfile.h b/src/platform/qt/InputProfile.h index 7180a70d1..d0d80e155 100644 --- a/src/platform/qt/InputProfile.h +++ b/src/platform/qt/InputProfile.h @@ -8,9 +8,7 @@ #include "GamepadAxisEvent.h" -extern "C" { #include "gba/interface.h" -} namespace QGBA { diff --git a/src/platform/qt/LibraryModel.cpp b/src/platform/qt/LibraryModel.cpp index 5341268e9..da085cf0a 100644 --- a/src/platform/qt/LibraryModel.cpp +++ b/src/platform/qt/LibraryModel.cpp @@ -5,9 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "LibraryModel.h" -extern "C" { #include "util/vfs.h" -} using namespace QGBA; diff --git a/src/platform/qt/LibraryModel.h b/src/platform/qt/LibraryModel.h index 3cf80f355..d11cdaaf7 100644 --- a/src/platform/qt/LibraryModel.h +++ b/src/platform/qt/LibraryModel.h @@ -8,9 +8,7 @@ #include -extern "C" { #include "core/library.h" -} struct VDir; diff --git a/src/platform/qt/LoadSaveState.cpp b/src/platform/qt/LoadSaveState.cpp index 4c6786a12..64210ce75 100644 --- a/src/platform/qt/LoadSaveState.cpp +++ b/src/platform/qt/LoadSaveState.cpp @@ -14,13 +14,11 @@ #include #include -extern "C" { #include "core/serialize.h" #ifdef M_CORE_GBA #include "gba/serialize.h" #endif #include "util/memory.h" -} using namespace QGBA; diff --git a/src/platform/qt/LogController.h b/src/platform/qt/LogController.h index bf02a9b85..b630f33e6 100644 --- a/src/platform/qt/LogController.h +++ b/src/platform/qt/LogController.h @@ -11,9 +11,7 @@ #include #include -extern "C" { #include "gba/gba.h" -} namespace QGBA { diff --git a/src/platform/qt/MemoryModel.cpp b/src/platform/qt/MemoryModel.cpp index a97e54f3c..888e020d0 100644 --- a/src/platform/qt/MemoryModel.cpp +++ b/src/platform/qt/MemoryModel.cpp @@ -19,9 +19,7 @@ #include #include -extern "C" { #include "core/core.h" -} using namespace QGBA; diff --git a/src/platform/qt/MemoryModel.h b/src/platform/qt/MemoryModel.h index 2defb510e..1e0fbd645 100644 --- a/src/platform/qt/MemoryModel.h +++ b/src/platform/qt/MemoryModel.h @@ -13,9 +13,7 @@ #include #include -extern "C" { #include "util/text-codec.h" -} struct mCore; diff --git a/src/platform/qt/MemoryView.cpp b/src/platform/qt/MemoryView.cpp index 07ad16254..9fdfb0704 100644 --- a/src/platform/qt/MemoryView.cpp +++ b/src/platform/qt/MemoryView.cpp @@ -8,7 +8,6 @@ #include "GameController.h" -extern "C" { #include "core/core.h" #ifdef M_CORE_GBA #include "gba/memory.h" @@ -16,7 +15,6 @@ extern "C" { #ifdef M_CORE_GB #include "gb/memory.h" #endif -} using namespace QGBA; diff --git a/src/platform/qt/MessagePainter.cpp b/src/platform/qt/MessagePainter.cpp index 7aa19a98e..6cb9b7835 100644 --- a/src/platform/qt/MessagePainter.cpp +++ b/src/platform/qt/MessagePainter.cpp @@ -9,9 +9,7 @@ #include -extern "C" { #include "gba/video.h" -} using namespace QGBA; diff --git a/src/platform/qt/MultiplayerController.cpp b/src/platform/qt/MultiplayerController.cpp index 49afdf125..850dd350e 100644 --- a/src/platform/qt/MultiplayerController.cpp +++ b/src/platform/qt/MultiplayerController.cpp @@ -7,14 +7,12 @@ #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; diff --git a/src/platform/qt/MultiplayerController.h b/src/platform/qt/MultiplayerController.h index 78be7dc35..ca88757fe 100644 --- a/src/platform/qt/MultiplayerController.h +++ b/src/platform/qt/MultiplayerController.h @@ -10,7 +10,6 @@ #include #include -extern "C" { #include "core/lockstep.h" #ifdef M_CORE_GBA #include "gba/sio/lockstep.h" @@ -18,7 +17,6 @@ extern "C" { #ifdef M_CORE_GB #include "gb/sio/lockstep.h" #endif -} namespace QGBA { diff --git a/src/platform/qt/ObjView.cpp b/src/platform/qt/ObjView.cpp index 569b24890..da6910c43 100644 --- a/src/platform/qt/ObjView.cpp +++ b/src/platform/qt/ObjView.cpp @@ -10,13 +10,11 @@ #include #include -extern "C" { #include "gba/gba.h" #ifdef M_CORE_GB #include "gb/gb.h" #include "gb/io.h" #endif -} using namespace QGBA; diff --git a/src/platform/qt/ObjView.h b/src/platform/qt/ObjView.h index 61cf43282..afa5f1c2a 100644 --- a/src/platform/qt/ObjView.h +++ b/src/platform/qt/ObjView.h @@ -11,9 +11,7 @@ #include "ui_ObjView.h" -extern "C" { #include "core/tile-cache.h" -} namespace QGBA { diff --git a/src/platform/qt/OverrideView.cpp b/src/platform/qt/OverrideView.cpp index 249baac52..d5875ebd0 100644 --- a/src/platform/qt/OverrideView.cpp +++ b/src/platform/qt/OverrideView.cpp @@ -12,16 +12,12 @@ #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; diff --git a/src/platform/qt/OverrideView.h b/src/platform/qt/OverrideView.h index dc31f2223..aad6709ab 100644 --- a/src/platform/qt/OverrideView.h +++ b/src/platform/qt/OverrideView.h @@ -9,9 +9,7 @@ #include #ifdef M_CORE_GB -extern "C" { #include "gb/overrides.h" -} #endif #include "ui_OverrideView.h" diff --git a/src/platform/qt/PaletteView.cpp b/src/platform/qt/PaletteView.cpp index dd917b555..8f756bec1 100644 --- a/src/platform/qt/PaletteView.cpp +++ b/src/platform/qt/PaletteView.cpp @@ -12,7 +12,6 @@ #include #include -extern "C" { #include "core/core.h" #include "util/export.h" #ifdef M_CORE_GA @@ -22,7 +21,6 @@ extern "C" { #include "gb/gb.h" #endif #include "util/vfs.h" -} using namespace QGBA; diff --git a/src/platform/qt/ROMInfo.cpp b/src/platform/qt/ROMInfo.cpp index 4271dc07d..bdea67c43 100644 --- a/src/platform/qt/ROMInfo.cpp +++ b/src/platform/qt/ROMInfo.cpp @@ -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 @@ extern "C" { #include "gba/gba.h" #endif #include "util/nointro.h" -} using namespace QGBA; diff --git a/src/platform/qt/SensorView.cpp b/src/platform/qt/SensorView.cpp index a5997ac3b..6305d801c 100644 --- a/src/platform/qt/SensorView.cpp +++ b/src/platform/qt/SensorView.cpp @@ -9,10 +9,8 @@ #include "GamepadAxisEvent.h" #include "InputController.h" -extern "C" { #include "core/core.h" #include "gba/gba.h" -} using namespace QGBA; diff --git a/src/platform/qt/SettingsView.cpp b/src/platform/qt/SettingsView.cpp index 8302ddb34..ef11f79ba 100644 --- a/src/platform/qt/SettingsView.cpp +++ b/src/platform/qt/SettingsView.cpp @@ -13,10 +13,8 @@ #include "InputController.h" #include "ShortcutView.h" -extern "C" { #include "core/serialize.h" #include "gba/gba.h" -} using namespace QGBA; diff --git a/src/platform/qt/ShaderSelector.cpp b/src/platform/qt/ShaderSelector.cpp index 3f60aeb61..b5f8feccd 100644 --- a/src/platform/qt/ShaderSelector.cpp +++ b/src/platform/qt/ShaderSelector.cpp @@ -17,14 +17,12 @@ #include #include -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; diff --git a/src/platform/qt/Swatch.cpp b/src/platform/qt/Swatch.cpp index f672a404d..5ff1fc2b6 100644 --- a/src/platform/qt/Swatch.cpp +++ b/src/platform/qt/Swatch.cpp @@ -8,9 +8,7 @@ #include #include -extern "C" { #include "core/interface.h" -} using namespace QGBA; diff --git a/src/platform/qt/TileView.cpp b/src/platform/qt/TileView.cpp index 5ac2edc84..c8b383741 100644 --- a/src/platform/qt/TileView.cpp +++ b/src/platform/qt/TileView.cpp @@ -10,11 +10,9 @@ #include #include -extern "C" { #ifdef M_CORE_GB #include "gb/gb.h" #endif -} using namespace QGBA; diff --git a/src/platform/qt/TileView.h b/src/platform/qt/TileView.h index 37b5ca78d..aef5b526f 100644 --- a/src/platform/qt/TileView.h +++ b/src/platform/qt/TileView.h @@ -11,9 +11,7 @@ #include "ui_TileView.h" -extern "C" { #include "core/tile-cache.h" -} namespace QGBA { diff --git a/src/platform/qt/VFileDevice.h b/src/platform/qt/VFileDevice.h index a99b39dba..2cdd85d14 100644 --- a/src/platform/qt/VFileDevice.h +++ b/src/platform/qt/VFileDevice.h @@ -8,9 +8,7 @@ #include -extern "C" { #include "util/vfs.h" -} namespace QGBA { diff --git a/src/platform/qt/VideoView.cpp b/src/platform/qt/VideoView.cpp index bb3805a4e..0e8433af0 100644 --- a/src/platform/qt/VideoView.cpp +++ b/src/platform/qt/VideoView.cpp @@ -13,9 +13,7 @@ #include #ifdef M_CORE_GB -extern "C" { #include "gb/video.h" -} #endif using namespace QGBA; diff --git a/src/platform/qt/VideoView.h b/src/platform/qt/VideoView.h index 360de48df..aeb4c0b02 100644 --- a/src/platform/qt/VideoView.h +++ b/src/platform/qt/VideoView.h @@ -12,9 +12,7 @@ #include "ui_VideoView.h" -extern "C" { #include "feature/ffmpeg/ffmpeg-encoder.h" -} namespace QGBA { diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 42f367b51..ca3ca0fae 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -42,7 +42,6 @@ #include "TileView.h" #include "VideoView.h" -extern "C" { #include "core/version.h" #ifdef M_CORE_GB #include "gb/gb.h" @@ -50,7 +49,6 @@ extern "C" { #include "feature/commandline.h" #include "util/nointro.h" #include "util/vfs.h" -} using namespace QGBA; diff --git a/src/platform/qt/Window.h b/src/platform/qt/Window.h index 14212bb5c..557b99a80 100644 --- a/src/platform/qt/Window.h +++ b/src/platform/qt/Window.h @@ -13,10 +13,8 @@ #include -extern "C" { #include "core/thread.h" #include "gba/gba.h" -} #include "InputController.h" #include "LoadSaveState.h" diff --git a/src/platform/sdl/gl-common.h b/src/platform/sdl/gl-common.h index 62f3a407c..4a22c1b34 100644 --- a/src/platform/sdl/gl-common.h +++ b/src/platform/sdl/gl-common.h @@ -5,9 +5,16 @@ * 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 diff --git a/src/platform/sdl/main.h b/src/platform/sdl/main.h index ccfb052a5..d8f34909b 100644 --- a/src/platform/sdl/main.h +++ b/src/platform/sdl/main.h @@ -6,6 +6,10 @@ #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 @@ void mSDLGLCreate(struct mSDLRenderer* renderer); #if defined(BUILD_GLES2) || defined(USE_EPOXY) void mSDLGLES2Create(struct mSDLRenderer* renderer); #endif + +CXX_GUARD_END + #endif diff --git a/src/platform/sdl/sdl-audio.h b/src/platform/sdl/sdl-audio.h index e51832d5d..f7001cb61 100644 --- a/src/platform/sdl/sdl-audio.h +++ b/src/platform/sdl/sdl-audio.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/log.h" #include @@ -36,4 +38,6 @@ void mSDLDeinitAudio(struct mSDLAudio* context); void mSDLPauseAudio(struct mSDLAudio* context); void mSDLResumeAudio(struct mSDLAudio* context); +CXX_GUARD_END + #endif diff --git a/src/platform/sdl/sdl-events.h b/src/platform/sdl/sdl-events.h index 435072d2a..eea7bb7ba 100644 --- a/src/platform/sdl/sdl-events.h +++ b/src/platform/sdl/sdl-events.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/interface.h" #include "core/log.h" #include "util/circle-buffer.h" @@ -110,4 +112,6 @@ void mSDLResumeScreensaver(struct mSDLEvents*); void mSDLSetScreensaverSuspendable(struct mSDLEvents*, bool suspendable); #endif +CXX_GUARD_END + #endif diff --git a/src/platform/video-backend.h b/src/platform/video-backend.h index b67b676be..31d7a5301 100644 --- a/src/platform/video-backend.h +++ b/src/platform/video-backend.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #ifdef _WIN32 #include typedef HWND WHandle; @@ -44,4 +46,6 @@ struct VideoShader { size_t nPasses; }; +CXX_GUARD_END + #endif diff --git a/src/util/circle-buffer.h b/src/util/circle-buffer.h index 77650ca84..e0cdc7bf2 100644 --- a/src/util/circle-buffer.h +++ b/src/util/circle-buffer.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct CircleBuffer { void* data; size_t capacity; @@ -30,4 +32,6 @@ 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 diff --git a/src/util/common.h b/src/util/common.h index 050db0513..28d62e061 100644 --- a/src/util/common.h +++ b/src/util/common.h @@ -6,6 +6,16 @@ #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 #include #include @@ -177,4 +187,6 @@ typedef intptr_t ssize_t; #define ROR(I, ROTATE) ((((uint32_t) (I)) >> ROTATE) | ((uint32_t) (I) << ((-ROTATE) & 31))) +CXX_GUARD_END + #endif diff --git a/src/util/configuration.h b/src/util/configuration.h index 5d16324dd..54134dab9 100644 --- a/src/util/configuration.h +++ b/src/util/configuration.h @@ -6,6 +6,10 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +#include "util/common.h" + +CXX_GUARD_START + #include "util/table.h" struct VFile; @@ -35,4 +39,6 @@ bool ConfigurationWriteSection(const struct Configuration*, const char* path, co void ConfigurationEnumerateSections(const struct Configuration* configuration, void (*handler)(const char* sectionName, void* user), void* user); +CXX_GUARD_END + #endif diff --git a/src/util/crc32.h b/src/util/crc32.h index 5e34b3feb..cb88f4337 100644 --- a/src/util/crc32.h +++ b/src/util/crc32.h @@ -8,10 +8,14 @@ #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 diff --git a/src/util/export.h b/src/util/export.h index 3e933620c..bbdb37ea2 100644 --- a/src/util/export.h +++ b/src/util/export.h @@ -8,9 +8,13 @@ #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 diff --git a/src/util/formatting.h b/src/util/formatting.h index b09c12944..ff1745aa6 100644 --- a/src/util/formatting.h +++ b/src/util/formatting.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "locale.h" #if defined(__APPLE__) || defined(__FreeBSD__) @@ -29,4 +31,6 @@ float strtof_u(const char* restrict str, char** restrict end); struct tm* localtime_r(const time_t* timep, struct tm* result); #endif +CXX_GUARD_END + #endif diff --git a/src/util/gui.h b/src/util/gui.h index fe7d851a0..526feab95 100644 --- a/src/util/gui.h +++ b/src/util/gui.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "core/input.h" #include "util/vector.h" @@ -81,4 +83,6 @@ void GUIPollInput(struct GUIParams* params, uint32_t* newInput, uint32_t* heldIn enum GUICursorState GUIPollCursor(struct GUIParams* params, unsigned* x, unsigned* y); void GUIInvalidateKeys(struct GUIParams* params); +CXX_GUARD_END + #endif diff --git a/src/util/gui/file-select.h b/src/util/gui/file-select.h index e804d66a7..c7df6668e 100644 --- a/src/util/gui/file-select.h +++ b/src/util/gui/file-select.h @@ -6,10 +6,16 @@ #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 diff --git a/src/util/gui/font.h b/src/util/gui/font.h index 7c936ffb9..464440025 100644 --- a/src/util/gui/font.h +++ b/src/util/gui/font.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct GUIFont; struct GUIFont* GUIFontCreate(void); void GUIFontDestroy(struct GUIFont*); @@ -84,4 +86,6 @@ void GUIFontDrawGlyph(const struct GUIFont*, int x, int y, uint32_t color, uint3 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 diff --git a/src/util/gui/menu.h b/src/util/gui/menu.h index eb34d99cd..b99bfac2d 100644 --- a/src/util/gui/menu.h +++ b/src/util/gui/menu.h @@ -6,6 +6,10 @@ #ifndef GUI_MENU_H #define GUI_MENU_H +#include "util/common.h" + +CXX_GUARD_START + #include "util/vector.h" struct GUIMenu; @@ -49,4 +53,6 @@ enum GUIMenuExitReason GUIShowMessageBox(struct GUIParams* params, int buttons, void GUIDrawBattery(struct GUIParams* params); void GUIDrawClock(struct GUIParams* params); +CXX_GUARD_END + #endif diff --git a/src/util/hash.h b/src/util/hash.h index 7a8e82099..31fd1f2b1 100644 --- a/src/util/hash.h +++ b/src/util/hash.h @@ -8,6 +8,10 @@ #include "util/common.h" +CXX_GUARD_START + uint32_t hash32(const void* key, int len, uint32_t seed); +CXX_GUARD_END + #endif diff --git a/src/util/math.h b/src/util/math.h index 31709e20a..6a69345f8 100644 --- a/src/util/math.h +++ b/src/util/math.h @@ -8,6 +8,8 @@ #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); @@ -56,4 +58,6 @@ static inline uint32_t toPow2(uint32_t bits) { return 1 << (32 - lz); } +CXX_GUARD_END + #endif diff --git a/src/util/memory.h b/src/util/memory.h index e78d87c7a..444f5c6bb 100644 --- a/src/util/memory.h +++ b/src/util/memory.h @@ -8,7 +8,11 @@ #include "util/common.h" +CXX_GUARD_START + void* anonymousMemoryMap(size_t size); void mappedMemoryFree(void* memory, size_t size); +CXX_GUARD_END + #endif diff --git a/src/util/nointro.h b/src/util/nointro.h index 50f4a23d2..46eb4088f 100644 --- a/src/util/nointro.h +++ b/src/util/nointro.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct NoIntroGame { const char* name; const char* romName; @@ -26,4 +28,6 @@ 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 diff --git a/src/util/patch-fast.h b/src/util/patch-fast.h index 34988160c..95a2503a4 100644 --- a/src/util/patch-fast.h +++ b/src/util/patch-fast.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #include "util/patch.h" #include "util/vector.h" @@ -31,4 +33,6 @@ 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 diff --git a/src/util/patch-ips.h b/src/util/patch-ips.h index 39c8f6e65..d730e68ba 100644 --- a/src/util/patch-ips.h +++ b/src/util/patch-ips.h @@ -8,8 +8,12 @@ #include "util/common.h" +CXX_GUARD_START + struct Patch; bool loadPatchIPS(struct Patch* patch); +CXX_GUARD_END + #endif diff --git a/src/util/patch-ups.h b/src/util/patch-ups.h index 23293409b..bc29c1afa 100644 --- a/src/util/patch-ups.h +++ b/src/util/patch-ups.h @@ -8,8 +8,12 @@ #include "util/common.h" +CXX_GUARD_START + struct Patch; bool loadPatchUPS(struct Patch* patch); +CXX_GUARD_END + #endif diff --git a/src/util/patch.h b/src/util/patch.h index f84d859df..e0af658ee 100644 --- a/src/util/patch.h +++ b/src/util/patch.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct VFile; struct Patch { @@ -19,4 +21,6 @@ struct Patch { bool loadPatch(struct VFile* vf, struct Patch* patch); +CXX_GUARD_END + #endif diff --git a/src/util/png-io.h b/src/util/png-io.h index d0fff9c70..25680e9c9 100644 --- a/src/util/png-io.h +++ b/src/util/png-io.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #ifdef USE_PNG #include @@ -37,4 +39,6 @@ void PNGReadClose(png_structp png, png_infop info, png_infop end); #endif +CXX_GUARD_END + #endif diff --git a/src/util/ring-fifo.h b/src/util/ring-fifo.h index 6ceb02ff7..a98d5f1f7 100644 --- a/src/util/ring-fifo.h +++ b/src/util/ring-fifo.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct RingFIFO { void* data; size_t capacity; @@ -22,4 +24,6 @@ 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 diff --git a/src/util/socket.h b/src/util/socket.h index 6ffe13608..12e509f83 100644 --- a/src/util/socket.h +++ b/src/util/socket.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #if defined(__cplusplus) && !defined(restrict) #define restrict __restrict__ #endif @@ -316,4 +318,6 @@ static inline int SocketPoll(size_t nSockets, Socket* reads, Socket* writes, Soc return result; } +CXX_GUARD_END + #endif diff --git a/src/util/string.h b/src/util/string.h index 4bf161f8a..04b0fce63 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #ifndef HAVE_STRNDUP // This is sometimes a macro char* strndup(const char* start, size_t len); @@ -36,4 +38,6 @@ const char* hex4(const char* line, uint8_t* out); void rtrim(char* string); +CXX_GUARD_END + #endif diff --git a/src/util/table.h b/src/util/table.h index 5dee643fd..1305b995e 100644 --- a/src/util/table.h +++ b/src/util/table.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct TableList; struct Table { @@ -46,4 +48,6 @@ 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 diff --git a/src/util/text-codec.h b/src/util/text-codec.h index e17436c7b..4ea3f8596 100644 --- a/src/util/text-codec.h +++ b/src/util/text-codec.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + struct TextCodecNode; struct TextCodec { struct TextCodecNode* forwardRoot; @@ -29,4 +31,6 @@ 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 diff --git a/src/util/threading.h b/src/util/threading.h index 32d805c67..21ed062b2 100644 --- a/src/util/threading.h +++ b/src/util/threading.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #ifndef DISABLE_THREADING #ifdef USE_PTHREADS #include "platform/posix/threading.h" @@ -85,4 +87,6 @@ static inline int ConditionWake(Condition* cond) { } #endif +CXX_GUARD_END + #endif diff --git a/src/util/vector.h b/src/util/vector.h index dee7ed77a..8e35caa79 100644 --- a/src/util/vector.h +++ b/src/util/vector.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #define DECLARE_VECTOR(NAME, TYPE) \ struct NAME { \ TYPE* vector; \ @@ -84,4 +86,6 @@ return member - (const TYPE*) vector->vector; \ } \ +CXX_GUARD_END + #endif diff --git a/src/util/vfs.h b/src/util/vfs.h index 19c71da92..d1ac0e69f 100644 --- a/src/util/vfs.h +++ b/src/util/vfs.h @@ -8,6 +8,8 @@ #include "util/common.h" +CXX_GUARD_START + #ifdef _WIN32 #include #include @@ -97,4 +99,6 @@ 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