aboutsummaryrefslogtreecommitdiff
path: root/Gem/develop/include
diff options
context:
space:
mode:
authorTravis CI <zmoelnig@travis-ci.umlaeute.mur.at>2019-02-06 20:30:34 +0000
committerTravis CI <zmoelnig@travis-ci.umlaeute.mur.at>2019-02-06 20:30:34 +0000
commit336aab27be02c79cebad1b9ee1a96425222036e0 (patch)
tree6e84cd57e96d570c6ad7e637f626a91663a9456b /Gem/develop/include
parent5c89557512beffebcd0770966a4414be4fb8572b (diff)
Gem 095a8d03d64b3263805ecbbcca479581b8c246a7 osx/x86_64
built 'master:095a8d03d64b3263805ecbbcca479581b8c246a7' for osx/x86_64
Diffstat (limited to 'Gem/develop/include')
-rw-r--r--Gem/develop/include/Gem/Base/CPPExtern.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/Gem/develop/include/Gem/Base/CPPExtern.h b/Gem/develop/include/Gem/Base/CPPExtern.h
index de320f9..e9190b7 100644
--- a/Gem/develop/include/Gem/Base/CPPExtern.h
+++ b/Gem/develop/include/Gem/Base/CPPExtern.h
@@ -332,21 +332,19 @@ static void obj_setupCallback(t_class *classPtr);
// (registering the class with pd)
// a static copy of this class is created at runtime, to actually do the setup-call
///////////////////////////////////////////////////////////////////////////////
+typedef void (*t_class_setup)(void);
+extern "C" { GEM_EXTERN void gem_register_class_setup(const char*name, t_class_setup); }
+
#ifdef NO_AUTO_REGISTER_CLASS
// if NO_AUTO_REGISTER_CLASS is defined, we will not register the class
# define AUTO_REGISTER_CLASS(NEW_CLASS) \
static int NEW_CLASS ## _dummyinstance
#else
// for debugging we can show the which classes are auto-registering
-# if 0
-# define POST_AUTOREGISTER(NEW_CLASS) post("auto-registering: "#NEW_CLASS)
-# else
-# define POST_AUTOREGISTER(NEW_CLASS)
-# endif
-# define AUTO_REGISTER_CLASS(NEW_CLASS) \
+# define AUTO_REGISTER_CLASS(NEW_CLASS) \
class NEW_CLASS ## _cppclass { \
public: \
- NEW_CLASS ## _cppclass(void) {POST_AUTOREGISTER(NEW_CLASS); NEW_CLASS ## _setup(); } \
+ NEW_CLASS ## _cppclass(void) {gem_register_class_setup(#NEW_CLASS, & NEW_CLASS ## _setup); } \
}; \
static NEW_CLASS ## _cppclass NEW_CLASS ## _instance
#endif