diff --git a/acinclude.m4 b/acinclude.m4 index f0a8266b..9ea0d7a2 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -305,7 +305,7 @@ AC_SUBST(ALSA_LIBS) AH_TOP([ /* - * Copyright (C) 2002-2003 The DOSBox Team + * Copyright (C) 2002-2004 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -331,4 +331,49 @@ AH_BOTTOM([#if C_HAS_ATTRIBUTE #define GCC_ATTRIBUTE(x) /* attribute not supported */ #endif]) +AH_BOTTOM([ +typedef double Real64; +#if SIZEOF_UNSIGNED_CHAR != 1 +# error "sizeof (unsigned char) != 1" +#else + typedef unsigned char Bit8u; + typedef signed char Bit8s; +#endif + +#if SIZEOF_UNSIGNED_SHORT != 2 +# error "sizeof (unsigned short) != 2" +#else + typedef unsigned short Bit16u; + typedef signed short Bit16s; +#endif + +#if SIZEOF_UNSIGNED_INT == 4 + typedef unsigned int Bit32u; + typedef signed int Bit32s; +#elif SIZEOF_UNSIGNED_LONG == 4 + typedef unsigned long Bit32u; + typedef signed long Bit32s; +#else +# error "can't find sizeof(type) of 4 bytes!" +#endif + +#if SIZEOF_UNSIGNED_LONG == 8 + typedef unsigned long Bit64u; + typedef signed long Bit64s; +#elif SIZEOF_UNSIGNED_LONG_LONG == 8 + typedef unsigned long long Bit64u; + typedef signed long long Bit64s; +#else +# error "can't find data type of 8 bytes" +#endif + +#if SIZEOF_INT_P == 4 + typedef Bit32u Bitu; + typedef Bit32s Bits; + #else + typedef Bit64u Bitu; + typedef Bit64s Bits; + #endif + +]) \ No newline at end of file diff --git a/configure.in b/configure.in index 657a3015..0cc5ca58 100644 --- a/configure.in +++ b/configure.in @@ -35,7 +35,12 @@ AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_STRUCT_TM - +AC_CHECK_SIZEOF(unsigned char) +AC_CHECK_SIZEOF(unsigned short) +AC_CHECK_SIZEOF(unsigned int) +AC_CHECK_SIZEOF(unsigned long) +AC_CHECK_SIZEOF(unsigned long long) +AC_CHECK_SIZEOF(int *) AC_MSG_CHECKING(if environ can be included) AC_TRY_LINK([#include diff --git a/include/dosbox.h b/include/dosbox.h index a1061790..afb93bb4 100644 --- a/include/dosbox.h +++ b/include/dosbox.h @@ -24,25 +24,6 @@ void E_Exit(char * message,...); void MSG_Add(const char*,const char*); //add messages to the internal langaugefile const char* MSG_Get(char const *); //get messages from the internal langaugafile -/* The internal types */ -typedef unsigned char Bit8u; -typedef signed char Bit8s; -typedef unsigned short Bit16u; -typedef signed short Bit16s; -typedef unsigned long Bit32u; -typedef signed long Bit32s; -typedef double Real64; -#if defined(_MSC_VER) -typedef unsigned __int64 Bit64u; -typedef signed __int64 Bit64s; -#else -typedef unsigned long long Bit64u; -typedef signed long long Bit64s; -#endif - -typedef unsigned int Bitu; -typedef signed int Bits; - #include #include "config.h" diff --git a/src/platform/visualc/config.h b/src/platform/visualc/config.h index c3260199..78ccbefc 100644 --- a/src/platform/visualc/config.h +++ b/src/platform/visualc/config.h @@ -39,3 +39,17 @@ #define ENVIRON_LINKED 1 #define GCC_ATTRIBUTE(x) /* attribute not supported */ + +typedef double Real64; +/* The internal types */ +typedef unsigned char Bit8u; +typedef signed char Bit8s; +typedef unsigned short Bit16u; +typedef signed short Bit16s; +typedef unsigned long Bit32u; +typedef signed long Bit32s; +typedef unsigned __int64 Bit64u; +typedef signed __int64 Bit64s; +typedef unsigned int Bitu; +typedef signed int Bits; +