-#define entityclass(...) OVERLOAD(entityclass, __VA_ARGS__)
+#define entityclass(...) EVAL(OVERLOAD(entityclass, __VA_ARGS__))
#define entityclass_1(name) entityclass_2(name, Object)
#ifndef QCC_SUPPORT_ENTITYCLASS
#define entityclass_2(name, base) typedef entity name
// Classes have a `spawn##cname(entity)` constructor
// The parameter is used across [[accumulate]] functions
-// Macro to hide this implementation detail
+// Macros to hide this implementation detail:
+#ifdef GMQCC
#define NEW(cname, ...) \
OVERLOAD(spawn##cname, new(cname), ##__VA_ARGS__)
#define CONSTRUCT(cname, ...) \
OVERLOAD(spawn##cname, this, ##__VA_ARGS__)
+#else
+#define NEW_(cname, ...) \
+ OVERLOAD_(spawn##cname, __VA_ARGS__)
+#define NEW(cname, ...) \
+ NEW_(cname, new(cname), ##__VA_ARGS__)(new(cname), ##__VA_ARGS__)
+
+#define CONSTRUCT_(cname, ...) \
+ OVERLOAD_(spawn##cname, __VA_ARGS__)
+#define CONSTRUCT(cname, ...) \
+ CONSTRUCT_(cname, this, ##__VA_ARGS__)(this, ##__VA_ARGS__)
+#endif
#define CONSTRUCTOR(cname, ...) \
cname OVERLOAD(spawn##cname, cname this, __VA_ARGS__) { return = this; } \