Bug 712034 - Clean up jstypes.h a bit; r=njn
authorMs2ger <ms2ger@gmail.com>
Sun, 15 Jan 2012 09:13:12 +0100
changeset 85712 d7984d345c24a28ec1c158d09a914ea12b008f29
parent 85711 c1577ea56e1725960cf2622c8013f263aabee7ce
child 85713 49afabda6701e120b15e625446cf067a1d450334
child 85766 bc30dee3a6f22a57e17d8382f9d416fbde1413ed
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs712034
milestone12.0a1
Bug 712034 - Clean up jstypes.h a bit; r=njn
js/src/jstypes.h
--- a/js/src/jstypes.h
+++ b/js/src/jstypes.h
@@ -49,16 +49,17 @@
 ** Instead of requiring these authors to find the dependent uses in their code
 ** and take the following steps only in those C files, we take steps once here
 ** for all C files.
 **/
 
 #ifndef jstypes_h___
 #define jstypes_h___
 
+#include "mozilla/Attributes.h"
 #include "mozilla/Util.h"
 
 #include "js-config.h"
 
 /***********************************************************************
 ** MACROS:      JS_EXTERN_API
 **              JS_EXPORT_API
 ** DESCRIPTION:
@@ -111,47 +112,25 @@
   ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
 #define JS_FASTCALL __attribute__((fastcall))
 #else
 #define JS_FASTCALL
 #define JS_NO_FASTCALL
 #endif
 
 #ifndef JS_INLINE
-# if defined __cplusplus
-#  define JS_INLINE          inline
-# elif defined _MSC_VER
-#  define JS_INLINE          __inline
-# elif defined __GNUC__
-#  define JS_INLINE          __inline__
-# else
-#  define JS_INLINE          inline
-# endif
+#define JS_INLINE MOZ_INLINE
 #endif
 
 #ifndef JS_ALWAYS_INLINE
-# if defined DEBUG
-#  define JS_ALWAYS_INLINE   JS_INLINE
-# elif defined _MSC_VER
-#  define JS_ALWAYS_INLINE   __forceinline
-# elif defined __GNUC__
-#  define JS_ALWAYS_INLINE   __attribute__((always_inline)) JS_INLINE
-# else
-#  define JS_ALWAYS_INLINE   JS_INLINE
-# endif
+#define JS_ALWAYS_INLINE MOZ_ALWAYS_INLINE
 #endif
 
 #ifndef JS_NEVER_INLINE
-# if defined _MSC_VER
-#  define JS_NEVER_INLINE __declspec(noinline)
-# elif defined __GNUC__
-#  define JS_NEVER_INLINE __attribute__((noinline))
-# else
-#  define JS_NEVER_INLINE
-# endif
+#define JS_NEVER_INLINE MOZ_NEVER_INLINE
 #endif
 
 #ifndef JS_WARN_UNUSED_RESULT
 # if defined __GNUC__
 #  define JS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
 # else
 #  define JS_WARN_UNUSED_RESULT
 # endif
@@ -249,39 +228,16 @@ JS_BEGIN_EXTERN_C
 **      define them to be wider (e.g., 32 or even 64 bits). These types are
 **      never valid for fields of a structure.
 ************************************************************************/
 
 typedef int JSIntn;
 typedef unsigned int JSUintn;
 
 /************************************************************************
-** TYPES:       JSSize
-** DESCRIPTION:
-**  A type for representing the size of objects.
-************************************************************************/
-typedef size_t JSSize;
-
-/************************************************************************
-** TYPES:       JSPtrDiff
-** DESCRIPTION:
-**  A type for pointer difference. Variables of this type are suitable
-**      for storing a pointer or pointer sutraction.
-************************************************************************/
-typedef ptrdiff_t JSPtrdiff;
-
-/************************************************************************
-** TYPES:       JSUptrdiff
-** DESCRIPTION:
-**  A type for pointer difference. Variables of this type are suitable
-**      for storing a pointer or pointer sutraction.
-************************************************************************/
-typedef uintptr_t JSUptrdiff;
-
-/************************************************************************
 ** TYPES:       JSBool
 ** DESCRIPTION:
 **  Use JSBool for variables and parameter types. Use JS_FALSE and JS_TRUE
 **      for clarity of target type in assignments and actual arguments. Use
 **      'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans
 **      just as you would C int-valued conditions.
 ************************************************************************/
 typedef JSIntn JSBool;