From 5971949c0c88281c7e5044c367a9d03597fca3fd Mon Sep 17 00:00:00 2001 From: Michael Adams Date: Sun, 16 Oct 2016 16:53:25 -0700 Subject: [PATCH] Changed jas_types.h to assume that header files required by the C99 standard are present. --- src/libjasper/include/jasper/jas_types.h | 97 +----------------------- 1 file changed, 4 insertions(+), 93 deletions(-) diff --git a/src/libjasper/include/jasper/jas_types.h b/src/libjasper/include/jasper/jas_types.h index 1acef111..32c541ce 100644 --- a/src/libjasper/include/jasper/jas_types.h +++ b/src/libjasper/include/jasper/jas_types.h @@ -92,103 +92,14 @@ #endif -#if defined(HAVE_STDLIB_H) -#undef false -#undef true +/* Note: The immediately following header files should eventually be removed. */ #include -#endif -#if defined(HAVE_STDDEF_H) #include -#endif -#if defined(HAVE_SYS_TYPES_H) -#include -#endif - -#ifndef __cplusplus -#if defined(HAVE_STDBOOL_H) -/* - * The C language implementation does correctly provide the standard header - * file "stdbool.h". - */ #include -#else - -/* - * The C language implementation does not provide the standard header file - * "stdbool.h" as required by ISO/IEC 9899:1999. Try to compensate for this - * braindamage below. - */ -#if !defined(bool) -#define bool int -#endif -#if !defined(true) -#define true 1 -#endif -#if !defined(false) -#define false 0 -#endif -#endif - -#endif - -#if defined(HAVE_STDINT_H) -/* - * The C language implementation does correctly provide the standard header - * file "stdint.h". - */ #include -#else -/* - * The C language implementation does not provide the standard header file - * "stdint.h" as required by ISO/IEC 9899:1999. Try to compensate for this - * braindamage below. - */ -#include -/**********/ -#if !defined(INT_FAST8_MIN) -typedef signed char int_fast8_t; -#define INT_FAST8_MIN (-127) -#define INT_FAST8_MAX 128 -#endif -/**********/ -#if !defined(UINT_FAST8_MAX) -typedef unsigned char uint_fast8_t; -#define UINT_FAST8_MAX 255 -#endif -/**********/ -#if !defined(INT_FAST16_MIN) -typedef short int_fast16_t; -#define INT_FAST16_MIN SHRT_MIN -#define INT_FAST16_MAX SHRT_MAX -#endif -/**********/ -#if !defined(UINT_FAST16_MAX) -typedef unsigned short uint_fast16_t; -#define UINT_FAST16_MAX USHRT_MAX -#endif -/**********/ -#if !defined(INT_FAST32_MIN) -typedef int int_fast32_t; -#define INT_FAST32_MIN INT_MIN -#define INT_FAST32_MAX INT_MAX -#endif -/**********/ -#if !defined(UINT_FAST32_MAX) -typedef unsigned int uint_fast32_t; -#define UINT_FAST32_MAX UINT_MAX -#endif -/**********/ -#if !defined(INT_FAST64_MIN) -typedef longlong int_fast64_t; -#define INT_FAST64_MIN LLONG_MIN -#define INT_FAST64_MAX LLONG_MAX -#endif -/**********/ -#if !defined(UINT_FAST64_MAX) -typedef ulonglong uint_fast64_t; -#define UINT_FAST64_MAX ULLONG_MAX -#endif -/**********/ + +#if defined(HAVE_SYS_TYPES_H) +#include #endif /* Hopefully, these macro definitions will fix more problems than they cause. */