Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 391423 - Reposition JS_(BEGIN|END)_EXTERN_C to avoid nesting #inc…
Browse files Browse the repository at this point in the history
…ludes. Patch by Edward Lee <edilee@mozilla.com>, r=jorendorff, r=bsmedberg
  • Loading branch information
jswalden committed Aug 10, 2007
1 parent 3677e7d commit 6bf9895
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/src/jsiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
#ifndef jsiter_h___
#define jsiter_h___

JS_BEGIN_EXTERN_C

/*
* JavaScript iterators.
*/
#include "jsprvtd.h"
#include "jspubtd.h"

JS_BEGIN_EXTERN_C

#define JSITER_ENUMERATE 0x1 /* for-in compatible hidden default iterator */
#define JSITER_FOREACH 0x2 /* return [key, value] pair rather than key */
#define JSITER_KEYVALUE 0x4 /* destructuring for-in wants [key, value] */
Expand Down
8 changes: 6 additions & 2 deletions js/src/jslock.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
#ifndef jslock_h__
#define jslock_h__

JS_BEGIN_EXTERN_C

#ifdef JS_THREADSAFE

#include "jstypes.h"
Expand All @@ -52,6 +50,8 @@ JS_BEGIN_EXTERN_C
#include "jsprvtd.h" /* for JSScope, etc. */
#include "jspubtd.h" /* for JSRuntime, etc. */

JS_BEGIN_EXTERN_C

#define Thin_GetWait(W) ((jsword)(W) & 0x1)
#define Thin_SetWait(W) ((jsword)(W) | 0x1)
#define Thin_RemoveWait(W) ((jsword)(W) & ~0x1)
Expand Down Expand Up @@ -112,7 +112,9 @@ typedef struct JSFatLockTable {
* to be fixed by moving JS_LOCK_SCOPE to jsscope.h, JS_LOCK_OBJ to jsobj.h,
* and so on.
*/
JS_END_EXTERN_C
#include "jsscope.h"
JS_BEGIN_EXTERN_C

#define JS_LOCK_RUNTIME(rt) js_LockRuntime(rt)
#define JS_UNLOCK_RUNTIME(rt) js_UnlockRuntime(rt)
Expand Down Expand Up @@ -212,6 +214,8 @@ extern JS_INLINE void js_Unlock(JSThinLock *tl, jsword me);

#else /* !JS_THREADSAFE */

JS_BEGIN_EXTERN_C

#define JS_ATOMIC_INCREMENT(p) (++*(p))
#define JS_ATOMIC_DECREMENT(p) (--*(p))
#define JS_ATOMIC_ADD(p,v) (*(p) += (v))
Expand Down
4 changes: 2 additions & 2 deletions js/src/jsxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
#ifndef jsxml_h___
#define jsxml_h___

JS_BEGIN_EXTERN_C

#include "jsstddef.h"
#include "jspubtd.h"

JS_BEGIN_EXTERN_C

extern const char js_AnyName_str[];
extern const char js_AttributeName_str[];
extern const char js_isXMLName_str[];
Expand Down

0 comments on commit 6bf9895

Please sign in to comment.