diff options
Diffstat (limited to 'modules/websocket/websocket_macros.h')
-rw-r--r-- | modules/websocket/websocket_macros.h | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/modules/websocket/websocket_macros.h b/modules/websocket/websocket_macros.h index a01ae65c56..b03bd8f45c 100644 --- a/modules/websocket/websocket_macros.h +++ b/modules/websocket/websocket_macros.h @@ -35,34 +35,32 @@ #define DEF_PKT_SHIFT 10 #define DEF_BUF_SHIFT 16 -/* clang-format off */ -#define GDCICLASS(CNAME) \ -public:\ - static CNAME *(*_create)();\ -\ - static Ref<CNAME > create_ref() {\ -\ - if (!_create)\ - return Ref<CNAME >();\ - return Ref<CNAME >(_create());\ - }\ -\ - static CNAME *create() {\ -\ - if (!_create)\ - return nullptr;\ - return _create();\ - }\ -protected:\ +#define GDCICLASS(CNAME) \ +public: \ + static CNAME *(*_create)(); \ + \ + static Ref<CNAME> create_ref() { \ + if (!_create) \ + return Ref<CNAME>(); \ + return Ref<CNAME>(_create()); \ + } \ + \ + static CNAME *create() { \ + if (!_create) \ + return nullptr; \ + return _create(); \ + } \ + \ +protected: #define GDCINULL(CNAME) \ -CNAME *(*CNAME::_create)() = nullptr; + CNAME *(*CNAME::_create)() = nullptr; -#define GDCIIMPL(IMPNAME, CNAME) \ -public:\ - static CNAME *_create() { return memnew(IMPNAME); }\ - static void make_default() { CNAME::_create = IMPNAME::_create; }\ -protected:\ -/* clang-format on */ +#define GDCIIMPL(IMPNAME, CNAME) \ +public: \ + static CNAME *_create() { return memnew(IMPNAME); } \ + static void make_default() { CNAME::_create = IMPNAME::_create; } \ + \ +protected: #endif // WEBSOCKET_MACROS_H |