diff --git a/src/audio/mixer.cpp b/src/audio/mixer.cpp index 2f594ff835..2b03f1b9f4 100644 --- a/src/audio/mixer.cpp +++ b/src/audio/mixer.cpp @@ -14,6 +14,7 @@ *****************************************************************************/ #pragma endregion +#include "../core/Guard.hpp" extern "C" { #include "../config.h" #include "../platform/platform.h" diff --git a/src/cmdline/CommandLine.cpp b/src/cmdline/CommandLine.cpp index 763367e514..f749365687 100644 --- a/src/cmdline/CommandLine.cpp +++ b/src/cmdline/CommandLine.cpp @@ -14,6 +14,8 @@ *****************************************************************************/ #pragma endregion +#include "../core/Guard.hpp" + extern "C" { #include "../platform/platform.h" diff --git a/src/cmdline/ConvertCommand.cpp b/src/cmdline/ConvertCommand.cpp index aad75516e1..ff2027d4e0 100644 --- a/src/cmdline/ConvertCommand.cpp +++ b/src/cmdline/ConvertCommand.cpp @@ -17,6 +17,7 @@ #include "../common.h" #include "../core/Console.hpp" #include "../core/Exception.hpp" +#include "../core/Guard.hpp" #include "../core/Path.hpp" #include "../rct1/S4Importer.h" #include "CommandLine.hpp" diff --git a/src/cmdline/RootCommands.cpp b/src/cmdline/RootCommands.cpp index 9f25711060..f4c017e10f 100644 --- a/src/cmdline/RootCommands.cpp +++ b/src/cmdline/RootCommands.cpp @@ -16,6 +16,8 @@ #include +#include "../core/Guard.hpp" + extern "C" { #include "../config.h" diff --git a/src/core/Guard.hpp b/src/core/Guard.hpp index 2c226d26c8..8daf25f6e0 100644 --- a/src/core/Guard.hpp +++ b/src/core/Guard.hpp @@ -16,6 +16,15 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void openrct2_assert(bool expression, const char * message, ...); + +#ifdef __cplusplus +} + #include /** @@ -48,3 +57,5 @@ namespace Guard }; #define GUARD_LINE "Location: %s:%d", __func__, __LINE__ + +#endif // __cplusplus diff --git a/src/localisation/language.cpp b/src/localisation/language.cpp index 44036a0f14..329e677d77 100644 --- a/src/localisation/language.cpp +++ b/src/localisation/language.cpp @@ -15,6 +15,7 @@ #pragma endregion #include +#include "../core/Guard.hpp" #include "../core/String.hpp" #include "../object/ObjectManager.h" #include "LanguagePack.h" diff --git a/src/network/network.cpp b/src/network/network.cpp index b9e16cf975..6d334e1464 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -23,6 +23,8 @@ #include #endif +#include "../core/Guard.hpp" + extern "C" { #include "../openrct2.h" #include "../platform/platform.h" diff --git a/src/openrct2.h b/src/openrct2.h index 88b3d6a5ef..67eb264628 100644 --- a/src/openrct2.h +++ b/src/openrct2.h @@ -18,6 +18,7 @@ #define _OPENRCT2_H_ #include "common.h" +#include "core/Guard.hpp" #include "platform/platform.h" #ifndef DISABLE_NETWORK @@ -61,7 +62,6 @@ void openrct2_dispose(); void openrct2_finish(); void openrct2_reset_object_tween_locations(); bool openrct2_setup_rct2_segment(); -void openrct2_assert(bool expression, const char * message, ...); int cmdline_run(const char **argv, int argc); diff --git a/src/util/util.c b/src/util/util.c index ca79080d65..ae14a99c4a 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -18,6 +18,7 @@ #include "../common.h" #include +#include "../core/Guard.hpp" #include "../localisation/localisation.h" #include "../platform/platform.h" #include "util.h"