applied Benjamin Riefenstahl's patches for building on Windows

This commit is contained in:
vdvo
2002-05-27 16:45:32 +00:00
parent a80a9680fe
commit 79fe4b68df
15 changed files with 76 additions and 113 deletions

View File

@@ -37,9 +37,23 @@ extern "C" {
#include <ctype.h>
#include <stdio.h>
#if !(defined( __BORLANDC__ ) || defined( __WIN32__ ))
#include "config.h"
#if defined(WIN32)
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
#define SIZEOF_UNSIGNED_CHAR 1
#define SIZEOF_UNSIGNED_SHORT 2
#define SIZEOF_UNSIGNED_LONG 4
/* compile time checks for good measure */
#define COMPILE_TIME_CHECK(tag,expr) \
typedef char tag##_CHECK[ (expr) ? 1 : -1 ]
COMPILE_TIME_CHECK( FLOAT, sizeof(float) == SIZEOF_FLOAT );
COMPILE_TIME_CHECK( DOUBLE, sizeof(double) == SIZEOF_DOUBLE );
COMPILE_TIME_CHECK( CHAR, sizeof(char) == SIZEOF_UNSIGNED_CHAR );
COMPILE_TIME_CHECK( SHORT, sizeof(short) == SIZEOF_UNSIGNED_SHORT );
COMPILE_TIME_CHECK( LONG, sizeof(long) == SIZEOF_UNSIGNED_LONG );
#endif
/* F32 */
#if SIZEOF_FLOAT == 4
@@ -114,19 +128,6 @@ extern "C" {
#error No 4 byte length type found.
#endif
#else
/* Borland or Wintel constants */
#define F32 float
#define F64 double
#define U8 unsigned char
#define U16 unsigned short
#define S16 signed short
#define U32 unsigned long
#define S32 signed long
#endif
U16 fil_sreadU16 (U8 * in);
U32 fil_sreadU32 (U8 * in);
F64 fil_sreadF64 (U8 * in);