From 05d8ab3000745332ec0a5c5cc5fdb91caae62b2c Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 4 Jul 2018 14:08:57 +0100 Subject: [PATCH] Fix Windows build Clean out legacy crap from stdint.h while we're here --- simgear/misc/stdint.hxx | 44 ++++------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/simgear/misc/stdint.hxx b/simgear/misc/stdint.hxx index 49e5817d..f52b3d0e 100644 --- a/simgear/misc/stdint.hxx +++ b/simgear/misc/stdint.hxx @@ -12,49 +12,13 @@ // $Id$ -////////////////////////////////////////////////////////////////////// -// -// There are many sick systems out there: -// -// check for sizeof(float) and sizeof(double) -// if sizeof(float) != 4 this code must be patched -// if sizeof(double) != 8 this code must be patched -// -// Those are comments I fetched out of glibc source: -// - s390 is big-endian -// - Sparc is big-endian, but v9 supports endian conversion -// on loads/stores and GCC supports such a mode. Be prepared. -// - The MIPS architecture has selectable endianness. -// - x86_64 is little-endian. -// - CRIS is little-endian. -// - m68k is big-endian. -// - Alpha is little-endian. -// - PowerPC can be little or big endian. -// - SH is bi-endian but with a big-endian FPU. -// - hppa1.1 big-endian. -// - ARM is (usually) little-endian but with a big-endian FPU. -// -////////////////////////////////////////////////////////////////////// +#include +#include // for _byteswap_foo on Win32 - -#ifdef _MSC_VER -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; -typedef signed __int64 int64_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned __int64 uint64_t; - -typedef int ssize_t; -#elif defined(sgi) || defined(__sun) -# include -#else -# include +#if defined(_MSC_VER) +using ssize_t = int64_t; // this is a POSIX type, not a C one #endif - inline uint16_t sg_bswap_16(uint16_t x) { #if defined(__llvm__) || \ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC)