mirror of
https://github.com/izzy2lost/Ghostship.git
synced 2026-06-19 01:17:03 -07:00
Fixed compilation error in a better way
This commit is contained in:
@@ -1,12 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "list/EngineEvent.h"
|
||||
#include "list/PlayerEvent.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -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 { \
|
||||
|
||||
Reference in New Issue
Block a user