Bug 200505 - Better fix for C/C++ syntax problems with declaring the JSTempVector template. r=jwalden
authorLuke Wagner <lw@mozilla.com>
Wed, 01 Jul 2009 16:15:01 -0700
changeset 30028 0091a489ba2cd13ab53ba2d403c93f192b2ab096
parent 30027 02eca43038ef1ce7ed75a2fc5b6bcc4a32e4b079
child 30029 cdc4a1b07287252ad1e4945b271a5836e8b39181
push id7883
push userrsayre@mozilla.com
push dateMon, 06 Jul 2009 21:24:48 +0000
treeherdermozilla-central@337bdbbcdc2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs200505
milestone1.9.2a1pre
Bug 200505 - Better fix for C/C++ syntax problems with declaring the JSTempVector template. r=jwalden
js/jsd/jsdebug.h
js/src/jsprvtd.h
--- a/js/jsd/jsdebug.h
+++ b/js/jsd/jsdebug.h
@@ -49,25 +49,23 @@
 extern "C"
 {
 #endif
 #include "jstypes.h"
 #ifdef __cplusplus
 }
 #endif
 
-#define WRAPPED_IN_EXTERN_C
 JS_BEGIN_EXTERN_C
 #include "jsapi.h"
 #include "jsdbgapi.h"
 #ifdef LIVEWIRE
 #include "lwdbgapi.h"
 #endif
 JS_END_EXTERN_C
-#undef POSSIBLY_INCLUDED_FROM_C
 
 JS_BEGIN_EXTERN_C
 
 /*
  * The linkage of JSD API functions differs depending on whether the file is
  * used within the JSD library or not.  Any source file within the JSD
  * libraray should define EXPORT_JSD_API whereas any client of the library
  * should not.
--- a/js/src/jsprvtd.h
+++ b/js/src/jsprvtd.h
@@ -134,30 +134,24 @@ typedef struct JSXML                JSXM
 typedef struct JSXMLArray           JSXMLArray;
 typedef struct JSXMLArrayCursor     JSXMLArrayCursor;
 
 /*
  * Template declarations.
  *
  * jsprvtd.h can be included in both C and C++ translation units.  For C++, it
  * may possibly be wrapped in an extern "C" block which does not agree with
- * templates.  Since there is no way to auto-detect whether or not we are in an
- * extern block, we rely on the C++/extern user to #define WRAPPED_IN_EXTERN_C
- * to let us know to temporarily exit the block.
+ * templates.
  */
 #ifdef __cplusplus
-# ifdef WRAPPED_IN_EXTERN_C
-}
-# endif
+extern "C++" {
 
 template <class T> class JSTempVector;
 
-# ifdef WRAPPED_IN_EXTERN_C
-extern "C" {
-# endif
+}
 #endif  /* __cplusplus */
 
 /* "Friend" types used by jscntxt.h and jsdbgapi.h. */
 typedef enum JSTrapStatus {
     JSTRAP_ERROR,
     JSTRAP_CONTINUE,
     JSTRAP_RETURN,
     JSTRAP_THROW,