From: Marcus Eggenberger Date: Tue, 25 Aug 2009 10:15:57 +0000 (+0200) Subject: Who would have thought, that macros need to be defined before they can X-Git-Tag: 0.5-rc1~21 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=26e1c7dca58f304774fe58292a553f0993d39ab0 Who would have thought, that macros need to be defined before they can be used... /me whistles innocently... --- diff --git a/src/common/syncableobject.h b/src/common/syncableobject.h index fda437f3..28e14720 100644 --- a/src/common/syncableobject.h +++ b/src/common/syncableobject.h @@ -28,6 +28,27 @@ #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(reinterpret_cast(&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(reinterpret_cast(&x)) -#define NO_ARG 0 - #endif