зеркало из https://github.com/mozilla/gecko-dev.git
OK, final fix not to impute JS_ARGUMENT_FORMATTER_DEFINED from va_start (duh).
Despite my stupidity here, I must say that over-includers elsewhere of both jspubtd.h and jsapi.h, and even jscntxt.h, with system headers intermixed, suck a lot too.
This commit is contained in:
Родитель
33592bf521
Коммит
314d395746
|
@ -192,10 +192,11 @@ JS_PushArgumentsVA(JSContext *cx, void **markp, const char *format, va_list ap);
|
|||
extern JS_PUBLIC_API(void)
|
||||
JS_PopArguments(JSContext *cx, void *mark);
|
||||
|
||||
#ifdef va_start
|
||||
#ifdef JS_ARGUMENT_FORMATTER_DEFINED
|
||||
|
||||
/*
|
||||
* Add and remove a format string handler for JS_{Convert,Push}Arguments{,VA}.
|
||||
* The handler function has this signature:
|
||||
* The handler function has this signature (see jspubtd.h):
|
||||
*
|
||||
* JSBool MyArgumentFormatter(JSContext *cx, const char *format,
|
||||
* JSBool fromJS, jsval **vpp, va_list *app);
|
||||
|
@ -232,27 +233,14 @@ JS_PopArguments(JSContext *cx, void *mark);
|
|||
* is typically a string constant. If format is in dynamic storage, it is up
|
||||
* to the caller to keep the string alive until Remove is called.
|
||||
*/
|
||||
|
||||
#ifndef JS_ARGUMENT_FORMATTER_DEFINED
|
||||
#define JS_ARGUMENT_FORMATTER_DEFINED 1
|
||||
/* XXX typedef'd here and in jspubtd.h #ifdef va_start, even though we include
|
||||
* XXX jspubtd.h up above, to avoid bad XXX includers who grab jspubtd.h, then
|
||||
* XXX <stdarg.h>, then jsapi.h, thereby hiding the jspubtd def but unhiding
|
||||
* XXX the typedef use below in JS_AddArgumentFormatter; we need jspubtd.h to
|
||||
* XXX do the typedef for jsapi.h-independent files such as jscntxt.h.
|
||||
*/
|
||||
typedef JSBool
|
||||
(* CRT_CALL JSArgumentFormatter)(JSContext *cx, const char *format,
|
||||
JSBool fromJS, jsval **vpp, va_list *app);
|
||||
#endif
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_AddArgumentFormatter(JSContext *cx, const char *format,
|
||||
JSArgumentFormatter formatter);
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS_RemoveArgumentFormatter(JSContext *cx, const char *format);
|
||||
#endif /* va_start */
|
||||
|
||||
#endif /* JS_ARGUMENT_FORMATTER_DEFINED */
|
||||
|
||||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp);
|
||||
|
|
|
@ -239,14 +239,12 @@ typedef const JSErrorFormatString *
|
|||
const uintN errorNumber);
|
||||
|
||||
#ifdef va_start
|
||||
#ifndef JS_ARGUMENT_FORMATTER_DEFINED
|
||||
#define JS_ARGUMENT_FORMATTER_DEFINED 1
|
||||
/* XXX typedef'd here and in jsapi.h, see XXX comment there. */
|
||||
|
||||
typedef JSBool
|
||||
(* CRT_CALL JSArgumentFormatter)(JSContext *cx, const char *format,
|
||||
JSBool fromJS, jsval **vpp, va_list *app);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
JS_END_EXTERN_C
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче