Fixed compilation error in a better way

This commit is contained in:
KiritoDv
2026-01-08 22:43:24 -06:00
parent 03d72c216d
commit d19e4a4e36
2 changed files with 10 additions and 8 deletions
-8
View File
@@ -1,12 +1,4 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "list/EngineEvent.h"
#include "list/PlayerEvent.h"
#ifdef __cplusplus
}
#endif
+10
View File
@@ -24,6 +24,7 @@ typedef struct {
EventCallback function;
} EventListener;
#ifndef __cplusplus
#ifdef INIT_EVENT_IDS
#define DECLARE_EVENT(eventName) \
uint32_t eventName##ID = -1;
@@ -31,6 +32,15 @@ typedef struct {
#define DECLARE_EVENT(eventName) \
extern uint32_t eventName##ID;
#endif
#else
#ifdef INIT_EVENT_IDS
#define DECLARE_EVENT(eventName) \
extern "C" uint32_t eventName##ID = -1;
#else
#define DECLARE_EVENT(eventName) \
extern "C" uint32_t eventName##ID;
#endif
#endif
#define DEFINE_EVENT(eventName, ...) \
typedef struct { \