diff --git a/js/src/configure.in b/js/src/configure.in index 17fded10717d..ceef221347b2 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -1596,6 +1596,7 @@ case "$target" in if test "$COMPILE_ENVIRONMENT"; then AC_CHECK_HEADERS(sys/inttypes.h) fi + AC_DEFINE(JS_SYS_TYPES_H_DEFINES_EXACT_SIZE_TYPES) AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) ;; diff --git a/js/src/js-config.h.in b/js/src/js-config.h.in index 5e667e31064e..7555d933f268 100644 --- a/js/src/js-config.h.in +++ b/js/src/js-config.h.in @@ -56,6 +56,9 @@ useable. See jstypes.h and jsstdint.h. */ #undef JS_HAVE_STDINT_H +/* Define to 1 if the defines int8_t, etc. */ +#undef JS_SYS_TYPES_H_DEFINES_EXACT_SIZE_TYPES + /* Define to 1 if the N-byte __intN types are defined by the compiler. */ #undef JS_HAVE___INTN diff --git a/js/src/jsinttypes.h b/js/src/jsinttypes.h index 7e06b3edf0d5..5f90eaaf7c0e 100644 --- a/js/src/jsinttypes.h +++ b/js/src/jsinttypes.h @@ -67,9 +67,14 @@ * itself is available. */ -#if defined(JS_HAVE_STDINT_H) +#if defined(JS_HAVE_STDINT_H) || \ + defined(JS_SYS_TYPES_H_DEFINES_EXACT_SIZE_TYPES) +#if defined(JS_HAVE_STDINT_H) #include +#else +#include +#endif typedef int8_t JSInt8; typedef int16_t JSInt16; diff --git a/js/src/jsstdint.h b/js/src/jsstdint.h index 4ced93e9c108..446a87319ac0 100644 --- a/js/src/jsstdint.h +++ b/js/src/jsstdint.h @@ -58,7 +58,8 @@ /* If we have a working stdint.h, then jsinttypes.h has already defined the standard integer types. Otherwise, define the standard names in terms of the 'JS' types. */ -#if ! defined(JS_HAVE_STDINT_H) +#if ! defined(JS_HAVE_STDINT_H) && \ + ! defined(JS_SYS_TYPES_H_DEFINES_EXACT_SIZE_TYPES) typedef JSInt8 int8_t; typedef JSInt16 int16_t;