*Clone* JSArgumentFormatter typedef from jspubtd.h to jsapi.h to cope with bad

includers who grab jspubtd.h first, then stdarg.h, then jsapi.h.  Suckage.
This commit is contained in:
brendan%netscape.com 1999-06-28 04:04:58 +00:00
Родитель 0476eb43d9
Коммит bfb9739a08
2 изменённых файлов: 18 добавлений и 4 удалений

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

@ -233,14 +233,18 @@ JS_PopArguments(JSContext *cx, void *mark);
* to the caller to keep the string alive until Remove is called.
*/
/* XXX typedef'd here rather than in jspubtd.h #ifdef va_start, to avoid bad
* XXX includers who grab jspubtd.h, then <stdarg.h>, then jsapi.h and unhide
* XXX the typedef uses below in JS_AddArgumentFormatter without exposing the
* XXX definition in jspubtd.h, which is of course include-idempotent.
#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,

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

@ -238,6 +238,16 @@ typedef const JSErrorFormatString *
(* CRT_CALL JSErrorCallback)(void *userRef, const char *locale,
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
#endif /* jspubtd_h___ */