X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsyncableobject.h;h=bec189a62c29e37bdee99adbf3609955c9fcbb58;hp=01fb39534be732d124b914069228cfa7e0a2a906;hb=4ae8f86c1ce452582d6fe576956c7c1bc1460adf;hpb=39eb2fda3eaef2de78a8134556015ff86e9b85d4 diff --git a/src/common/syncableobject.h b/src/common/syncableobject.h index 01fb3953..bec189a6 100644 --- a/src/common/syncableobject.h +++ b/src/common/syncableobject.h @@ -28,7 +28,29 @@ #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_CC_MSVC +# 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_CC_MSVC + +#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 public: @@ -92,21 +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 SYNC_OTHER(x, ...) sync_call__(SignalProxy::Server, #x, __VA_ARGS__); -# define REQUEST(...) sync_call__(SignalProxy::Client, __func__, __VA_ARGS__); -# define REQUEST_OTHER(x, ...) sync_call__(SignalProxy::Client, #x, __VA_ARGS__); -#endif //Q_WS_WIN - - -#define ARG(x) const_cast(reinterpret_cast(&x)) -#define NO_ARG 0 - #endif