diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-12 01:39:50 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-12 01:47:45 +0200 |
commit | 9996a3eb72611304ae26f97729a92e99d07cfda2 (patch) | |
tree | f7e4a3c7ab5248f290f662af35ce2cd1ed1dedff /compat/util.hpp | |
parent | ef76246a9afc12c735ea8e0317d45b9c474a3e5a (diff) |
compat/util: add few attribute macros
Diffstat (limited to 'compat/util.hpp')
-rw-r--r-- | compat/util.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/compat/util.hpp b/compat/util.hpp index ee462d0e..60427b53 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -78,3 +78,23 @@ template<typename t> using qshared = QSharedPointer<t>; #else # define OTR_NEVER_INLINE #endif + +#if defined _MSC_VER || defined __GNUG__ +# define OTR_RESTRICT __restrict +#else +# define OTR_RESTRICT +#endif + +#if defined _MSC_VER +# define OTR_ALWAYS_INLINE __forceinline +#elif defined __GNUG__ +# define OTR_ALWAYS_INLINE __attribute__((always_inline)) +#else +# define OTR_ALWAYS_INLINE inline +#endif + +#if defined __GNUG__ +# define OTR_FLATTEN __attribute__((flatten)) +#else +# define OTR_FLATTEN OTR_ALWAYS_INLINE +#endif |