diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2019-08-07 21:45:12 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2019-08-09 23:04:28 +0200 |
commit | f7bbf2c1d8d780294f3e016aff239ca35eb6516e (patch) | |
tree | e09ab6112e02b2215b2d59ac24d3d6ea2edac745 /gnuradio-runtime/include/gnuradio/attributes.h | |
parent | 78431dc6941e3acc67c858277dfe4a0ed583643c (diff) |
Tree: clang-format without the include sorting
Diffstat (limited to 'gnuradio-runtime/include/gnuradio/attributes.h')
-rw-r--r-- | gnuradio-runtime/include/gnuradio/attributes.h | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/gnuradio-runtime/include/gnuradio/attributes.h b/gnuradio-runtime/include/gnuradio/attributes.h index 250683f248..e5b2f98f03 100644 --- a/gnuradio-runtime/include/gnuradio/attributes.h +++ b/gnuradio-runtime/include/gnuradio/attributes.h @@ -26,65 +26,69 @@ // Cross-platform attribute macros //////////////////////////////////////////////////////////////////////// #if defined __GNUC__ -# define __GR_ATTR_ALIGNED(x) __attribute__((aligned(x))) -# define __GR_ATTR_UNUSED __attribute__((unused)) -# define __GR_ATTR_INLINE __attribute__((always_inline)) -# define __GR_ATTR_DEPRECATED __attribute__((deprecated)) -# if __GNUC__ >= 4 -# define __GR_ATTR_EXPORT __attribute__((visibility("default"))) -# define __GR_ATTR_IMPORT __attribute__((visibility("default"))) -# else -# define __GR_ATTR_EXPORT -# define __GR_ATTR_IMPORT -# endif +#define __GR_ATTR_ALIGNED(x) __attribute__((aligned(x))) +#define __GR_ATTR_UNUSED __attribute__((unused)) +#define __GR_ATTR_INLINE __attribute__((always_inline)) +#define __GR_ATTR_DEPRECATED __attribute__((deprecated)) +#if __GNUC__ >= 4 +#define __GR_ATTR_EXPORT __attribute__((visibility("default"))) +#define __GR_ATTR_IMPORT __attribute__((visibility("default"))) +#else +#define __GR_ATTR_EXPORT +#define __GR_ATTR_IMPORT +#endif #elif defined __clang__ -# define __GR_ATTR_ALIGNED(x) __attribute__((aligned(x))) -# define __GR_ATTR_UNUSED __attribute__((unused)) -# define __GR_ATTR_INLINE __attribute__((always_inline)) -# define __GR_ATTR_DEPRECATED __attribute__((deprecated)) -# define __GR_ATTR_EXPORT __attribute__((visibility("default"))) -# define __GR_ATTR_IMPORT __attribute__((visibility("default"))) +#define __GR_ATTR_ALIGNED(x) __attribute__((aligned(x))) +#define __GR_ATTR_UNUSED __attribute__((unused)) +#define __GR_ATTR_INLINE __attribute__((always_inline)) +#define __GR_ATTR_DEPRECATED __attribute__((deprecated)) +#define __GR_ATTR_EXPORT __attribute__((visibility("default"))) +#define __GR_ATTR_IMPORT __attribute__((visibility("default"))) #elif _MSC_VER -# define __GR_ATTR_ALIGNED(x) __declspec(align(x)) -# define __GR_ATTR_UNUSED -# define __GR_ATTR_INLINE __forceinline -# define __GR_ATTR_DEPRECATED __declspec(deprecated) -# define __GR_ATTR_EXPORT __declspec(dllexport) -# define __GR_ATTR_IMPORT __declspec(dllimport) +#define __GR_ATTR_ALIGNED(x) __declspec(align(x)) +#define __GR_ATTR_UNUSED +#define __GR_ATTR_INLINE __forceinline +#define __GR_ATTR_DEPRECATED __declspec(deprecated) +#define __GR_ATTR_EXPORT __declspec(dllexport) +#define __GR_ATTR_IMPORT __declspec(dllimport) #else -# define __GR_ATTR_ALIGNED(x) -# define __GR_ATTR_UNUSED -# define __GR_ATTR_INLINE -# define __GR_ATTR_DEPRECATED -# define __GR_ATTR_EXPORT -# define __GR_ATTR_IMPORT +#define __GR_ATTR_ALIGNED(x) +#define __GR_ATTR_UNUSED +#define __GR_ATTR_INLINE +#define __GR_ATTR_DEPRECATED +#define __GR_ATTR_EXPORT +#define __GR_ATTR_IMPORT #endif //////////////////////////////////////////////////////////////////////// // define inline when building C //////////////////////////////////////////////////////////////////////// #if defined(_MSC_VER) && !defined(__cplusplus) && !defined(inline) -# define inline __inline +#define inline __inline #endif //////////////////////////////////////////////////////////////////////// // suppress warnings //////////////////////////////////////////////////////////////////////// #ifdef _MSC_VER -# pragma warning(disable: 4251) // class 'A<T>' needs to have dll-interface to be used by clients of class 'B' -# pragma warning(disable: 4275) // non dll-interface class ... used as base for dll-interface class ... -# pragma warning(disable: 4244) // conversion from 'double' to 'float', possible loss of data -# pragma warning(disable: 4305) // 'initializing' : truncation from 'double' to 'float' -# pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +#pragma warning(disable : 4251) // class 'A<T>' needs to have dll-interface to be used by + // clients of class 'B' +#pragma warning(disable : 4275) // non dll-interface class ... used as base for + // dll-interface class ... +#pragma warning( \ + disable : 4244) // conversion from 'double' to 'float', possible loss of data +#pragma warning(disable : 4305) // 'initializing' : truncation from 'double' to 'float' +#pragma warning(disable : 4290) // C++ exception specification ignored except to indicate + // a function is not __declspec(nothrow) #endif //////////////////////////////////////////////////////////////////////// // implement cross-compiler VLA macros //////////////////////////////////////////////////////////////////////// #ifdef _MSC_VER -# define __GR_VLA(TYPE, buf, size) TYPE * buf = (TYPE *) alloca(sizeof(TYPE) * (size)) +#define __GR_VLA(TYPE, buf, size) TYPE* buf = (TYPE*)alloca(sizeof(TYPE) * (size)) #else -# define __GR_VLA(TYPE, buf, size) TYPE buf[size] +#define __GR_VLA(TYPE, buf, size) TYPE buf[size] #endif #endif /* INCLUDED_GNURADIO_ATTRIBUTES_H */ |