Bug 831741 - Followup: Remove remaining __cplusplus bits from /js (with exceptions). r=jorendorff

This commit is contained in:
Cykesiopka 2013-06-26 21:35:11 -04:00
parent 1b72254da9
commit 06857ab4f5
8 changed files with 17 additions and 39 deletions

View File

@ -11,25 +11,13 @@
#ifndef jsdebug_h___
#define jsdebug_h___
/* Get jstypes.h included first. After that we can use PR macros for doing
* this extern "C" stuff!
*/
#ifdef __cplusplus
extern "C"
{
#endif
#include "jstypes.h"
#ifdef __cplusplus
}
#endif
#include "jsapi.h"
#include "jsdbgapi.h"
#ifdef LIVEWIRE
#include "lwdbgapi.h"
#endif
JS_BEGIN_EXTERN_C
extern "C" {
/*
* The linkage of JSD API functions differs depending on whether the file is
@ -1559,6 +1547,6 @@ JSDLW_ProcessedToRawLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
#endif
/***************************************************************************/
JS_END_EXTERN_C
} // extern "C"
#endif /* jsdebug_h___ */

View File

@ -14,7 +14,7 @@
#include <stdio.h>
#include "jstypes.h"
JS_BEGIN_EXTERN_C
extern "C" {
typedef uint32_t JSHashNumber;
typedef struct JSHashEntry JSHashEntry;
@ -82,11 +82,9 @@ JS_HashTableDestroy(JSHashTable *ht);
extern JSHashEntry **
JS_HashTableRawLookup(JSHashTable *ht, JSHashNumber keyHash, const void *key);
#ifdef __cplusplus
extern JSHashEntry *
JS_HashTableRawAdd(JSHashTable *ht, JSHashEntry **&hep, JSHashNumber keyHash,
const void *key, void *value);
#endif
extern void
JS_HashTableRawRemove(JSHashTable *ht, JSHashEntry **hep, JSHashEntry *he);
@ -115,6 +113,6 @@ JS_HashString(const void *key);
extern int
JS_CompareValues(const void *v1, const void *v2);
JS_END_EXTERN_C
} // extern "C"
#endif /* jshash_h___ */

View File

@ -170,7 +170,7 @@ static JS_INLINE void js_free(void* p)
}
#endif/* JS_USE_CUSTOM_ALLOCATOR */
JS_BEGIN_EXTERN_C
extern "C" {
/*
* Replace bit-scanning code sequences with CPU-specific instructions to
@ -314,7 +314,7 @@ JS_STATIC_ASSERT(sizeof(unsigned long long) == sizeof(uint64_t));
# error "NOT SUPPORTED"
#endif
JS_END_EXTERN_C
} // extern "C"
/*
* Internal function.

View File

@ -53,7 +53,7 @@ namespace JS { class Value; }
* nice symbolic type tags, however we can only do this when we can force the
* underlying type of the enum to be the desired size.
*/
#if defined(__cplusplus) && !defined(__SUNPRO_CC) && !defined(__xlC__)
#if !defined(__SUNPRO_CC) && !defined(__xlC__)
#if defined(_MSC_VER)
# define JS_ENUM_HEADER(id, type) enum id : type
@ -132,7 +132,7 @@ JS_STATIC_ASSERT(sizeof(JSValueShiftedTag) == sizeof(uint64_t));
#endif
#else /* defined(__cplusplus) */
#else /* !defined(__SUNPRO_CC) && !defined(__xlC__) */
typedef uint8_t JSValueType;
#define JSVAL_TYPE_DOUBLE ((uint8_t)0x00)
@ -180,7 +180,7 @@ typedef uint64_t JSValueShiftedTag;
#define JSVAL_SHIFTED_TAG_OBJECT (((uint64_t)JSVAL_TAG_OBJECT) << JSVAL_TAG_SHIFT)
#endif /* JS_BITS_PER_WORD */
#endif /* defined(__cplusplus) && !defined(__SUNPRO_CC) */
#endif /* !defined(__SUNPRO_CC) && !defined(__xlC__) */
#define JSVAL_LOWER_INCL_TYPE_OF_OBJ_OR_NULL_SET JSVAL_TYPE_NULL
#define JSVAL_UPPER_EXCL_TYPE_OF_PRIMITIVE_SET JSVAL_TYPE_OBJECT
@ -265,7 +265,7 @@ typedef union jsval_layout
typedef union jsval_layout
{
uint64_t asBits;
#if (!defined(_WIN64) && defined(__cplusplus))
#if !defined(_WIN64)
/* MSVC does not pack these correctly :-( */
struct {
uint64_t payload47 : 47;

View File

@ -244,10 +244,6 @@ extern void *MALLOC(size_t);
#include "math.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CONST
#ifdef KR_headers
#define CONST /* blank */
@ -3250,6 +3246,3 @@ dtoa
*rve = s;
return s0;
}
#ifdef __cplusplus
}
#endif

View File

@ -194,10 +194,10 @@ static const JSErrorFormatString *
my_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber);
#ifdef EDITLINE
JS_BEGIN_EXTERN_C
extern "C" {
extern JS_EXPORT_API(char *) readline(const char *prompt);
extern JS_EXPORT_API(void) add_history(char *line);
JS_END_EXTERN_C
} // extern "C"
#endif
static void

View File

@ -40,16 +40,16 @@
#define XPC_LOG_CLEAR_INDENT() XPC_Log_Clear_Indent()
#define XPC_LOG_FINISH() XPC_Log_Finish()
JS_BEGIN_EXTERN_C
extern "C" {
void XPC_Log_print(const char *fmt, ...);
bool XPC_Log_Check(int i);
bool XPC_Log_Check(int i);
void XPC_Log_Indent();
void XPC_Log_Outdent();
void XPC_Log_Clear_Indent();
void XPC_Log_Finish();
JS_END_EXTERN_C
} // extern "C"
#else

View File

@ -1619,7 +1619,7 @@ nsXPConnect::ReadFunction(nsIObjectInputStream *stream, JSContext *cx, JSObject
}
/* These are here to be callable from a debugger */
JS_BEGIN_EXTERN_C
extern "C" {
JS_EXPORT_API(void) DumpJSStack()
{
nsresult rv;
@ -1668,5 +1668,4 @@ JS_EXPORT_API(void) DumpCompleteHeap()
nsJSContext::CycleCollectNow(alltracesListener);
}
JS_END_EXTERN_C
} // extern "C"