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:
brendan%netscape.com 1999-06-28 04:50:37 +00:00
Родитель 33592bf521
Коммит 314d395746
2 изменённых файлов: 6 добавлений и 20 удалений

Просмотреть файл

@ -192,10 +192,11 @@ JS_PushArgumentsVA(JSContext *cx, void **markp, const char *format, va_list ap);
extern JS_PUBLIC_API(void) extern JS_PUBLIC_API(void)
JS_PopArguments(JSContext *cx, void *mark); 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}. * 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 MyArgumentFormatter(JSContext *cx, const char *format,
* JSBool fromJS, jsval **vpp, va_list *app); * 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 * 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. * 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_PUBLIC_API(JSBool)
JS_AddArgumentFormatter(JSContext *cx, const char *format, JS_AddArgumentFormatter(JSContext *cx, const char *format,
JSArgumentFormatter formatter); JSArgumentFormatter formatter);
JS_PUBLIC_API(void) JS_PUBLIC_API(void)
JS_RemoveArgumentFormatter(JSContext *cx, const char *format); JS_RemoveArgumentFormatter(JSContext *cx, const char *format);
#endif /* va_start */
#endif /* JS_ARGUMENT_FORMATTER_DEFINED */
extern JS_PUBLIC_API(JSBool) extern JS_PUBLIC_API(JSBool)
JS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp); JS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp);

Просмотреть файл

@ -239,14 +239,12 @@ typedef const JSErrorFormatString *
const uintN errorNumber); const uintN errorNumber);
#ifdef va_start #ifdef va_start
#ifndef JS_ARGUMENT_FORMATTER_DEFINED
#define JS_ARGUMENT_FORMATTER_DEFINED 1 #define JS_ARGUMENT_FORMATTER_DEFINED 1
/* XXX typedef'd here and in jsapi.h, see XXX comment there. */
typedef JSBool typedef JSBool
(* CRT_CALL JSArgumentFormatter)(JSContext *cx, const char *format, (* CRT_CALL JSArgumentFormatter)(JSContext *cx, const char *format,
JSBool fromJS, jsval **vpp, va_list *app); JSBool fromJS, jsval **vpp, va_list *app);
#endif #endif
#endif
JS_END_EXTERN_C JS_END_EXTERN_C