Bug 782408: Update nrappkit to use stddint types r=jesup
authorEKR <ekr@rtfm.com>
Sun, 07 Oct 2012 10:16:35 -0700
changeset 109580 386f6fb98537f1b90c9f0f571851126df79c3a93
parent 109579 d407f51ca61e0e64cb5984a0ffa9bc83de9d77c2
child 109581 e6df45a289022aef32c4249cd283f1d358958c15
child 109583 bf0aa600323fb6a0e6bbfb2d04c41eec930b597d
push id23634
push userphilringnalda@gmail.com
push dateMon, 08 Oct 2012 01:32:21 +0000
treeherdermozilla-central@e6df45a28902 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs782408
milestone18.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 782408: Update nrappkit to use stddint types r=jesup
media/mtransport/objs.mk
media/mtransport/third_party/nICEr/nicer.gyp
media/mtransport/third_party/nrappkit/nrappkit.gyp
media/mtransport/third_party/nrappkit/src/util/libekr/r_types.h
--- a/media/mtransport/objs.mk
+++ b/media/mtransport/objs.mk
@@ -42,16 +42,23 @@ endif
 ifeq ($(OS_ARCH), WINNT)
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/win32/include \
   -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \
   $(NULL)
 DEFINES += -DWIN
 endif
 
+DEFINES += \
+   -DR_PLATFORM_INT_TYPES='"mozilla/StandardInteger.h"' \
+   -DR_DEFINED_INT2=int16_t -DR_DEFINED_UINT2=uint16_t \
+   -DR_DEFINED_INT4=int32_t -DR_DEFINED_UINT4=uint32_t \
+   -DR_DEFINED_INT8=int64_t -DR_DEFINED_UINT8=uint64_t \
+   $(NULL)
+
 MTRANSPORT_LCPPSRCS = \
   dtlsidentity.cpp \
   nricectx.cpp \
   nricemediastream.cpp \
   nr_socket_prsock.cpp \
   nr_timer.cpp \
   transportflow.cpp \
   transportlayer.cpp \
--- a/media/mtransport/third_party/nICEr/nicer.gyp
+++ b/media/mtransport/third_party/nICEr/nicer.gyp
@@ -25,16 +25,19 @@
  	      '../nrappkit/src/port/generic/include',
 
               # INTERNAL
               "./src/crypto",
               "./src/ice",
               "./src/net",
               "./src/stun",
               "./src/util",
+
+	      # Mozilla, hopefully towards the end
+             '$(DEPTH)/dist/include',
           ],
 
           'sources' : [
                 # Crypto
                 "./src/crypto/nr_crypto.c",
                 "./src/crypto/nr_crypto.h",
                 #"./src/crypto/nr_crypto_openssl.c",
                 #"./src/crypto/nr_crypto_openssl.h",
@@ -111,16 +114,23 @@
               'USE_TURN',
               'USE_ICE',
               'USE_RFC_3489_BACKWARDS_COMPATIBLE',
               'USE_STUND_0_96',
               'USE_STUN_PEDANTIC',
               'USE_TURN',
               'NR_SOCKET_IS_VOID_PTR',
               'restrict=',
+	      'R_PLATFORM_INT_TYPES=\'"mozilla/StandardInteger.h"\'',
+	      'R_DEFINED_INT2=int16_t',
+	      'R_DEFINED_UINT2=uint16_t',
+	      'R_DEFINED_INT4=int32_t',
+	      'R_DEFINED_UINT4=uint32_t',
+	      'R_DEFINED_INT8=int64_t',
+	      'R_DEFINED_UINT8=uint64_t',
           ],
           
           'conditions' : [
               ## Mac
               [ 'OS == "mac"', {
                 'cflags_mozilla': [
                     '-Werror',
                     '-Wall',
@@ -156,24 +166,16 @@
                     'USE_ICE',
                     'USE_TURN',
                     'USE_RFC_3489_BACKWARDS_COMPATIBLE',
                     'USE_STUND_0_96',
                     'USE_STUN_PEDANTIC',
                     '_CRT_SECURE_NO_WARNINGS',
                     '__UNUSED__=',
                     'HAVE_STRDUP',
-                    'SIZEOF_SHORT=2',
-                    'SIZEOF_UNSIGNED_SHORT=2',
-                    'SIZEOF_INT=4',
-                    'SIZEOF_UNSIGNED_INT=4',
-                    'SIZEOF_LONG=4',
-                    'SIZEOF_UNSIGNED_LONG=4',
-                    'SIZEOF_LONG_LONG=8',
-                    'SIZEOF_UNSIGNED_LONG_LONG=8',
                     'NO_REG_RPC'
                 ],
 
 		 'include_dirs': [
 		     '../nrappkit/src/port/win32/include'
 		 ],
               }],
 
--- a/media/mtransport/third_party/nrappkit/nrappkit.gyp
+++ b/media/mtransport/third_party/nrappkit/nrappkit.gyp
@@ -8,28 +8,28 @@
 {
   'targets' : [
       {
         	'target_name' : 'nrappkit',
           'type' : 'static_library',
 
           'include_dirs' : [
               # EXTERNAL
-              
-
-
               # INTERNAL
 	      'src/event',
 	      'src/log',
               'src/port/generic/include',
 	      'src/registry',
 	      'src/share',
 	      'src/stats',
 	      'src/util',
-	      'src/util/libekr'
+	      'src/util/libekr',
+
+	      # Mozilla, hopefully towards the end
+             '$(DEPTH)/dist/include',
           ],
 
           'sources' : [
 	      # Shared
 #              './src/share/nr_api.h',
               './src/share/nr_common.h',
 #              './src/share/nr_dynlib.h',
               './src/share/nr_reg_keys.h',
@@ -132,16 +132,23 @@
               #'./src/stats/nrstats.h',
               #'./src/stats/nrstats_app.c',
               #'./src/stats/nrstats_int.h',
               #'./src/stats/nrstats_memory.c',
           ],
           
           'defines' : [
               'SANITY_CHECKS',
+	      'R_PLATFORM_INT_TYPES=\'"mozilla/StandardInteger.h"\'',
+	      'R_DEFINED_INT2=int16_t',
+	      'R_DEFINED_UINT2=uint16_t',
+	      'R_DEFINED_INT4=int32_t',
+	      'R_DEFINED_UINT4=uint32_t',
+	      'R_DEFINED_INT8=int64_t',
+	      'R_DEFINED_UINT8=uint64_t',
           ],
           
           'conditions' : [
               ## Mac
               [ 'OS == "mac"', {
                 'cflags_mozilla': [
                     '-Werror',
                     '-Wall',
@@ -172,24 +179,16 @@
               }],
               
               ## Win
               [ 'OS == "win"', {
                  'defines' : [
                      'WIN',
                      '__UNUSED__=""',
                      'HAVE_STRDUP=1',
-                     'SIZEOF_SHORT=2',
-                     'SIZEOF_UNSIGNED_SHORT=2',
-                     'SIZEOF_INT=4',
-                     'SIZEOF_UNSIGNED_INT=4',
-                     'SIZEOF_LONG=4',
-                     'SIZEOF_UNSIGNED_LONG=4',
-                     'SIZEOF_LONG_LONG=8',
-                     'SIZEOF_UNSIGNED_LONG_LONG=8',
                      'NO_REG_RPC'
                  ],
 
 		 'include_dirs': [
 		     'src/port/win32/include'
 		 ],
 
 		 'sources': [
--- a/media/mtransport/third_party/nrappkit/src/util/libekr/r_types.h
+++ b/media/mtransport/third_party/nrappkit/src/util/libekr/r_types.h
@@ -79,78 +79,94 @@
 
    ekr@rtfm.com  Tue Dec 22 10:36:02 1998
  */
 
 
 #ifndef _r_types_h
 #define _r_types_h
 
+/* Either define R_PLATFORM_INT_TYPES or be on a platform that
+   has stdint.h */
+#ifdef R_PLATFORM_INT_TYPES
+#include R_PLATFORM_INT_TYPES
+#else
+#include <stdint.h>
+#endif
+
 #ifndef R_DEFINED_INT2
 #ifndef SIZEOF_INT
 typedef short INT2;
 #else
 # if (SIZEOF_INT==2)
 typedef int INT2;
 # elif (SIZEOF_SHORT==2)
 typedef short INT2;
 # elif (SIZEOF_LONG==2)
 typedef long INT2;
 # else
 # error no type for INT2
 # endif
 #endif
+#else
+typedef R_DEFINED_INT2 INT2;
 #endif
 
 #ifndef R_DEFINED_UINT2
 #ifndef SIZEOF_UNSIGNED_INT
 typedef unsigned short UINT2;
 #else
 # if (SIZEOF_UNSIGNED_INT==2)
 typedef unsigned int UINT2;
 # elif (SIZEOF_UNSIGNED_SHORT==2)
 typedef unsigned short UINT2;
 # elif (SIZEOF_UNSIGNED_LONG==2)
 typedef unsigned long UINT2;
 # else
 # error no type for UINT2
 # endif
 #endif
+#else
+typedef R_DEFINED_UINT2 UINT2;
 #endif
 
 #ifndef R_DEFINED_INT4
 #ifndef SIZEOF_INT
 typedef int INT4;
 #else
 # if (SIZEOF_INT==4)
 typedef int INT4;
 # elif (SIZEOF_SHORT==4)
 typedef short INT4;
 # elif (SIZEOF_LONG==4)
 typedef long INT4;
 # else
 # error no type for INT4
 # endif
 #endif
+#else
+typedef R_DEFINED_INT4 INT4;
 #endif
 
 #ifndef R_DEFINED_UINT4
 #ifndef SIZEOF_UNSIGNED_INT
 typedef unsigned int UINT4;
 #else
 # if (SIZEOF_UNSIGNED_INT==4)
 typedef unsigned int UINT4;
 # elif (SIZEOF_UNSIGNED_SHORT==4)
 typedef unsigned short UINT4;
 # elif (SIZEOF_UNSIGNED_LONG==4)
 typedef unsigned long UINT4;
 # else
 # error no type for UINT4
 # endif
 #endif
+#else
+typedef R_DEFINED_UINT4 UINT4;
 #endif
 
 #ifndef R_DEFINED_INT8
 #ifndef SIZEOF_INT
 typedef long long INT8;
 #else
 # if (SIZEOF_INT==8)
 typedef int INT8;
@@ -159,16 +175,18 @@ typedef short INT8;
 # elif (SIZEOF_LONG==8)
 typedef long INT8;
 # elif (SIZEOF_LONG_LONG==8)
 typedef long long INT8;
 # else
 # error no type for INT8
 # endif
 #endif
+#else
+typedef R_DEFINED_INT8 INT8;
 #endif
 
 #ifndef R_DEFINED_UINT8
 #ifndef SIZEOF_UNSIGNED_INT
 typedef unsigned long long UINT8;
 #else
 # if (SIZEOF_UNSIGNED_INT==8)
 typedef unsigned int UINT8;
@@ -177,16 +195,19 @@ typedef unsigned short UINT8;
 # elif (SIZEOF_UNSIGNED_LONG==8)
 typedef unsigned long UINT8;
 # elif (SIZEOF_UNSIGNED_LONG_LONG==8)
 typedef unsigned long long UINT8;
 # else
 # error no type for UINT8
 # endif
 #endif
+#else
+typedef R_DEFINED_UINT8 UINT8;
 #endif
 
 #ifndef R_DEFINED_UCHAR
 typedef unsigned char UCHAR;
+#else
+typedef R_DEFINED_UCHAR UCHAR;
+#endif
 #endif
 
-#endif
-