Who would have thought, that macros need to be defined before they can
authorMarcus Eggenberger <egs@quassel-irc.org>
Tue, 25 Aug 2009 10:15:57 +0000 (12:15 +0200)
committerMarcus Eggenberger <egs@quassel-irc.org>
Tue, 25 Aug 2009 10:15:57 +0000 (12:15 +0200)
be used...
/me whistles innocently...

src/common/syncableobject.h

index fda437f..28e1472 100644 (file)
 
 #include "signalproxy.h"
 
+
+
+#define SYNCABLE_OBJECT static const int _classNameOffset__;
+#define INIT_SYNCABLE_OBJECT(x) const int x ::_classNameOffset__ = QByteArray(staticMetaObject.className()).length() + 2;
+
+#ifdef Q_WS_WIN
+#    define SYNC(...) sync_call__(SignalProxy::Server, (__FUNCTION__ + _classNameOffset__), __VA_ARGS__);
+#    define REQUEST(...) sync_call__(SignalProxy::Client, (__FUNCTION__ + _classNameOffset__) , __VA_ARGS__);
+#else
+#    define SYNC(...) sync_call__(SignalProxy::Server, __func__, __VA_ARGS__);
+#    define REQUEST(...) sync_call__(SignalProxy::Client, __func__, __VA_ARGS__);
+#endif //Q_WS_WIN
+
+#define SYNC_OTHER(x, ...) sync_call__(SignalProxy::Server, #x, __VA_ARGS__);
+#define REQUEST_OTHER(x, ...) sync_call__(SignalProxy::Client, #x, __VA_ARGS__);
+
+
+#define ARG(x) const_cast<void *>(reinterpret_cast<const void*>(&x))
+#define NO_ARG 0
+
+
 class SyncableObject : public QObject {
   SYNCABLE_OBJECT
   Q_OBJECT
@@ -93,22 +114,4 @@ private:
   friend class SignalProxy;
 };
 
-#define SYNCABLE_OBJECT static const int _classNameOffset__;
-#define INIT_SYNCABLE_OBJECT(x) const int x ::_classNameOffset__ = QByteArray(staticMetaObject.className()).length() + 2;
-
-#ifdef Q_WS_WIN
-#    define SYNC(...) sync_call__(SignalProxy::Server, (__FUNCTION__ + _classNameOffset__), __VA_ARGS__);
-#    define REQUEST(...) sync_call__(SignalProxy::Client, (__FUNCTION__ + _classNameOffset__) , __VA_ARGS__);
-#else
-#    define SYNC(...) sync_call__(SignalProxy::Server, __func__, __VA_ARGS__);
-#    define REQUEST(...) sync_call__(SignalProxy::Client, __func__, __VA_ARGS__);
-#endif //Q_WS_WIN
-
-#define SYNC_OTHER(x, ...) sync_call__(SignalProxy::Server, #x, __VA_ARGS__);
-#define REQUEST_OTHER(x, ...) sync_call__(SignalProxy::Client, #x, __VA_ARGS__);
-
-
-#define ARG(x) const_cast<void *>(reinterpret_cast<const void*>(&x))
-#define NO_ARG 0
-
 #endif