Bug 928210 - Get rid of MOZ_INLINE
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Tue, 22 Oct 2013 06:34:24 +0900
changeset 166381 e5e074ddca9e5fa433a8537898a4a8d093e05d9c
parent 166380 0bdd39cd9e6cc64f4bb448d85b93474012be6468
child 166382 5ee5595998460658ca101492eef576e3ca6eedb2
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs928210
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 928210 - Get rid of MOZ_INLINE
memory/build/mozmemory.h
mfbt/Attributes.h
--- a/memory/build/mozmemory.h
+++ b/memory/build/mozmemory.h
@@ -33,17 +33,17 @@ MOZ_BEGIN_EXTERN_C
 #  include <malloc/malloc.h>
 #else
 MOZ_MEMORY_API size_t malloc_good_size_impl(size_t size);
 
 /* Note: the MOZ_GLUE_IN_PROGRAM ifdef below is there to avoid -Werror turning
  * the protective if into errors. MOZ_GLUE_IN_PROGRAM is what triggers MFBT_API
  * to use weak imports. */
 
-static MOZ_INLINE size_t _malloc_good_size(size_t size) {
+static inline size_t _malloc_good_size(size_t size) {
 #  if defined(MOZ_GLUE_IN_PROGRAM) && !defined(IMPL_MFBT)
   if (!malloc_good_size)
     return size;
 #  endif
   return malloc_good_size_impl(size);
 }
 
 #  define malloc_good_size _malloc_good_size
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -7,53 +7,39 @@
 /* Implementations of various class and method modifier attributes. */
 
 #ifndef mozilla_Attributes_h
 #define mozilla_Attributes_h
 
 #include "mozilla/Compiler.h"
 
 /*
- * MOZ_INLINE is a macro which expands to tell the compiler that the method
- * decorated with it should be inlined.  This macro is usable from C and C++
- * code, even though C89 does not support the |inline| keyword.  The compiler
- * may ignore this directive if it chooses.
- */
-#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
-
-/*
  * MOZ_ALWAYS_INLINE is a macro which expands to tell the compiler that the
  * method decorated with it must be inlined, even if the compiler thinks
- * otherwise.  This is only a (much) stronger version of the MOZ_INLINE hint:
+ * otherwise.  This is only a (much) stronger version of the inline hint:
  * compilers are not guaranteed to respect it (although they're much more likely
  * to do so).
  *
  * The MOZ_ALWAYS_INLINE_EVEN_DEBUG macro is yet stronger. It tells the
  * compiler to inline even in DEBUG builds. It should be used very rarely.
  */
 #if defined(_MSC_VER)
 #  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __forceinline
 #elif defined(__GNUC__)
-#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __attribute__((always_inline)) MOZ_INLINE
+#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __attribute__((always_inline)) inline
 #else
-#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     MOZ_INLINE
+#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     inline
 #endif
 
-#if defined(DEBUG)
-#  define MOZ_ALWAYS_INLINE     MOZ_INLINE
+#if !defined(DEBUG)
+#  define MOZ_ALWAYS_INLINE     MOZ_ALWAYS_INLINE_EVEN_DEBUG
+#elif defined(_MSC_VER) && !defined(__cplusplus)
+#  define MOZ_ALWAYS_INLINE     __inline
 #else
-#  define MOZ_ALWAYS_INLINE     MOZ_ALWAYS_INLINE_EVEN_DEBUG
+#  define MOZ_ALWAYS_INLINE     inline
 #endif
 
 /*
  * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality
  * without warnings (functionality used by the macros below).  These modes are
  * detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, more
  * standardly, by checking whether __cplusplus has a C++11 or greater value.
  * Current versions of g++ do not correctly set __cplusplus, so we check both