From cd7f02a3dbcc20eea3f9c6043491715a417e4996 Mon Sep 17 00:00:00 2001 From: 0scar Date: Sun, 18 Feb 2024 10:58:48 +0100 Subject: Add C++ header guard --- src/core/include/engine/core/dltools.h | 7 +++++++ src/core/include/engine/core/logging.h | 7 +++++++ src/core/include/engine/core/memory.h | 7 +++++++ src/core/include/engine/core/platform.h | 7 +++++++ src/core/include/engine/core/state.h | 7 +++++++ src/core/include/engine/core/thread.h | 7 +++++++ src/core/include/engine/core/types.h | 7 +++++++ src/core/include/engine/engine.h | 7 +++++++ 8 files changed, 56 insertions(+) (limited to 'src/core/include/engine') diff --git a/src/core/include/engine/core/dltools.h b/src/core/include/engine/core/dltools.h index 5a53f49..d9c74ee 100644 --- a/src/core/include/engine/core/dltools.h +++ b/src/core/include/engine/core/dltools.h @@ -1,6 +1,10 @@ #ifndef DLTOOLS_H #define DLTOOLS_H +#ifdef __cplusplus +extern "C" { +#endif + #include /* Utility functions for handling runtime linked shared libraries */ @@ -13,4 +17,7 @@ void* dynamic_library_reload(void* shared_library, const char* library_path); void* dynamic_library_get_symbol(void* shared_library, const char* symbol); char* dynamic_library_get_error(void); +#ifdef __cplusplus +} +#endif #endif diff --git a/src/core/include/engine/core/logging.h b/src/core/include/engine/core/logging.h index 52bb446..cd55442 100644 --- a/src/core/include/engine/core/logging.h +++ b/src/core/include/engine/core/logging.h @@ -1,6 +1,10 @@ #ifndef LOGGING_H #define LOGGING_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -46,4 +50,7 @@ void WARN(const char* fmt, ...); void ERROR(const char* fmt, ...); +#ifdef __cplusplus +} +#endif #endif diff --git a/src/core/include/engine/core/memory.h b/src/core/include/engine/core/memory.h index dbdd065..d04d58e 100644 --- a/src/core/include/engine/core/memory.h +++ b/src/core/include/engine/core/memory.h @@ -1,6 +1,10 @@ #ifndef MEMORY_H #define MEMORY_H +#ifdef __cplusplus +extern "C" { +#endif + #include typedef struct memory { @@ -21,4 +25,7 @@ void memory_free(memory* mem, usize size); void memory_clear(memory* mem); +#ifdef __cplusplus +} +#endif #endif diff --git a/src/core/include/engine/core/platform.h b/src/core/include/engine/core/platform.h index 76137c9..9fe22b3 100644 --- a/src/core/include/engine/core/platform.h +++ b/src/core/include/engine/core/platform.h @@ -1,6 +1,10 @@ #ifndef ENGINE_CORE_PLATFORM_H #define ENGINE_CORE_PLATFORM_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -51,4 +55,7 @@ typedef struct Platform { binding_t bindings_global[NUM_GLOBAL_BINDINGS]; } Platform; +#ifdef __cplusplus +} +#endif #endif diff --git a/src/core/include/engine/core/state.h b/src/core/include/engine/core/state.h index ee4741e..a6a5e84 100644 --- a/src/core/include/engine/core/state.h +++ b/src/core/include/engine/core/state.h @@ -1,6 +1,10 @@ #ifndef STATE_H #define STATE_H +#ifdef __cplusplus +extern "C" { +#endif + #include typedef enum StateType { @@ -31,4 +35,7 @@ bool state_refresh_input_ctx(void* lib, i_ctx** ctx, usize ctx_len); #endif +#ifdef __cplusplus +} +#endif #endif diff --git a/src/core/include/engine/core/thread.h b/src/core/include/engine/core/thread.h index ee61893..3d2e6b9 100644 --- a/src/core/include/engine/core/thread.h +++ b/src/core/include/engine/core/thread.h @@ -1,6 +1,10 @@ #ifndef THREAD_H #define THREAD_H +#ifdef __cplusplus +extern "C" { +#endif + #include typedef u64 thread_t; @@ -9,4 +13,7 @@ typedef void*(thread_fn(void*)); thread_t thread_spawn(thread_fn* routine, void* arg); void thread_join(thread_t thread); +#ifdef __cplusplus +} +#endif #endif diff --git a/src/core/include/engine/core/types.h b/src/core/include/engine/core/types.h index 934cb63..a7d794d 100644 --- a/src/core/include/engine/core/types.h +++ b/src/core/include/engine/core/types.h @@ -1,6 +1,10 @@ #ifndef ENGINE_TYPES_H #define ENGINE_TYPES_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -31,4 +35,7 @@ typedef i32 isize; typedef bool(predicate_t)(const void*); +#ifdef __cplusplus +} +#endif #endif diff --git a/src/core/include/engine/engine.h b/src/core/include/engine/engine.h index 75f6313..9036520 100644 --- a/src/core/include/engine/engine.h +++ b/src/core/include/engine/engine.h @@ -1,6 +1,10 @@ #ifndef ENGINE_ENGINE_H #define ENGINE_ENGINE_H +#ifdef __cplusplus +extern "C" { +#endif + #include /* TODO: Cleanup the includes, ideally this header file should only include all @@ -48,4 +52,7 @@ v2_i32* get_mousepos(void); /* move this */ void delay(uint32_t ms); +#ifdef __cplusplus +} +#endif #endif -- cgit v1.3