diff --git a/mfbt/Types.h b/mfbt/Types.h index f17b05150985..24bd6263e2da 100644 --- a/mfbt/Types.h +++ b/mfbt/Types.h @@ -79,9 +79,9 @@ * other code needs to see import declarations when using mfbt. */ #if defined(IMPL_MFBT) -# define MFBT_API(type_) MOZ_EXPORT_API(type_) +# define MFBT_API(type_) MOZ_EXPORT_API(type_) #else -# define MFBT_API(type_) MOZ_IMPORT_API(type_) +# define MFBT_API(type_) MOZ_IMPORT_API(type_) #endif @@ -99,32 +99,32 @@ * for forward compatibility. */ #if defined(__clang__) -# if __clang_major__ >= 3 -# define MOZ_HAVE_CXX11_DELETE -# define MOZ_HAVE_CXX11_OVERRIDE -# elif __clang_major__ == 2 -# if __clang_minor__ >= 9 -# define MOZ_HAVE_CXX11_DELETE -# endif -# endif -#elif defined(__GNUC__) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L -# if __GNUC__ > 4 -# define MOZ_HAVE_CXX11_DELETE -# define MOZ_HAVE_CXX11_OVERRIDE -# elif __GNUC__ == 4 -# if __GNUC_MINOR__ >= 7 -# define MOZ_HAVE_CXX11_OVERRIDE -# endif -# if __GNUC_MINOR__ >= 4 +# if __clang_major__ >= 3 # define MOZ_HAVE_CXX11_DELETE -# endif +# define MOZ_HAVE_CXX11_OVERRIDE +# elif __clang_major__ == 2 +# if __clang_minor__ >= 9 +# define MOZ_HAVE_CXX11_DELETE +# endif +# endif +#elif defined(__GNUC__) +# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L +# if __GNUC__ > 4 +# define MOZ_HAVE_CXX11_DELETE +# define MOZ_HAVE_CXX11_OVERRIDE +# elif __GNUC__ == 4 +# if __GNUC_MINOR__ >= 7 +# define MOZ_HAVE_CXX11_OVERRIDE +# endif +# if __GNUC_MINOR__ >= 4 +# define MOZ_HAVE_CXX11_DELETE +# endif +# endif # endif -# endif #elif defined(_MSC_VER) -# if _MSC_VER >= 1400 -# define MOZ_HAVE_CXX11_OVERRIDE -# endif +# if _MSC_VER >= 1400 +# define MOZ_HAVE_CXX11_OVERRIDE +# endif #endif /* @@ -150,9 +150,9 @@ * backstop, method declarations using MOZ_DELETE should be private. */ #if defined(MOZ_HAVE_CXX11_DELETE) -# define MOZ_DELETE = delete +# define MOZ_DELETE = delete #else -# define MOZ_DELETE /* no support */ +# define MOZ_DELETE /* no support */ #endif /* @@ -191,9 +191,9 @@ * of course must still be used correctly to not break C++11 compilers). */ #if defined(MOZ_HAVE_CXX11_OVERRIDE) -# define MOZ_OVERRIDE override +# define MOZ_OVERRIDE override #else -# define MOZ_OVERRIDE /* no support */ +# define MOZ_OVERRIDE /* no support */ #endif #endif /* __cplusplus */ diff --git a/mfbt/Util.h b/mfbt/Util.h index 5322cf28dcb4..6d87a25ee672 100644 --- a/mfbt/Util.h +++ b/mfbt/Util.h @@ -69,14 +69,10 @@ MOZ_END_EXTERN_C * which it fails will stop running in a loud and dramatic way. */ #ifdef DEBUG - -# define MOZ_ASSERT(expr_) \ - ((expr_) ? (void)0 : JS_Assert(#expr_, __FILE__, __LINE__)) - +# define MOZ_ASSERT(expr_) \ + ((expr_) ? (void)0 : JS_Assert(#expr_, __FILE__, __LINE__)) #else - -# define MOZ_ASSERT(expr_) ((void)0) - +# define MOZ_ASSERT(expr_) ((void)0) #endif /* DEBUG */ /* @@ -86,15 +82,15 @@ MOZ_END_EXTERN_C * may ignore this directive if it chooses. */ #ifndef MOZ_INLINE -# if defined __cplusplus -# define MOZ_INLINE inline -# elif defined _MSC_VER -# define MOZ_INLINE __inline -# elif defined __GNUC__ -# define MOZ_INLINE __inline__ -# else -# define MOZ_INLINE inline -# endif +# if defined __cplusplus +# define MOZ_INLINE inline +# elif defined _MSC_VER +# define MOZ_INLINE __inline +# elif defined __GNUC__ +# define MOZ_INLINE __inline__ +# else +# define MOZ_INLINE inline +# endif #endif /* @@ -105,15 +101,15 @@ MOZ_END_EXTERN_C * to do so). */ #ifndef MOZ_ALWAYS_INLINE -# if defined DEBUG -# define MOZ_ALWAYS_INLINE MOZ_INLINE -# elif defined _MSC_VER -# define MOZ_ALWAYS_INLINE __forceinline -# elif defined __GNUC__ -# define MOZ_ALWAYS_INLINE __attribute__((always_inline)) MOZ_INLINE -# else -# define MOZ_ALWAYS_INLINE MOZ_INLINE -# endif +# if defined DEBUG +# define MOZ_ALWAYS_INLINE MOZ_INLINE +# elif defined _MSC_VER +# define MOZ_ALWAYS_INLINE __forceinline +# elif defined __GNUC__ +# define MOZ_ALWAYS_INLINE __attribute__((always_inline)) MOZ_INLINE +# else +# define MOZ_ALWAYS_INLINE MOZ_INLINE +# endif #endif /* @@ -123,13 +119,13 @@ MOZ_END_EXTERN_C * guaranteed to support this, but most do. */ #ifndef MOZ_NEVER_INLINE -# if defined _MSC_VER -# define MOZ_NEVER_INLINE __declspec(noinline) -# elif defined __GNUC__ -# define MOZ_NEVER_INLINE __attribute__((noinline)) -# else -# define MOZ_NEVER_INLINE -# endif +# if defined _MSC_VER +# define MOZ_NEVER_INLINE __declspec(noinline) +# elif defined __GNUC__ +# define MOZ_NEVER_INLINE __attribute__((noinline)) +# else +# define MOZ_NEVER_INLINE +# endif #endif #ifdef __cplusplus @@ -224,18 +220,14 @@ public: */ #if defined(__GNUC__) -#define MOZ_ALIGNED_DECL(_type, _align) \ - _type __attribute__((aligned(_align))) - +# define MOZ_ALIGNED_DECL(_type, _align) \ + _type __attribute__((aligned(_align))) #elif defined(_MSC_VER) -#define MOZ_ALIGNED_DECL(_type, _align) \ - __declspec(align(_align)) _type - +# define MOZ_ALIGNED_DECL(_type, _align) \ + __declspec(align(_align)) _type #else - -#warning "We don't know how to align variables on this compiler." -#define MOZ_ALIGNED_DECL(_type, _align) _type - +# warning "We don't know how to align variables on this compiler." +# define MOZ_ALIGNED_DECL(_type, _align) _type #endif /*