From e9d5e2e3c9329fcd6156c72c103169605a8718f8 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 7 Sep 2017 09:12:06 -0700 Subject: [PATCH] SCP: Leverage stdint.h for environments where it is available --- sim_defs.h | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/sim_defs.h b/sim_defs.h index 0eaca5e9..bc3246d6 100644 --- a/sim_defs.h +++ b/sim_defs.h @@ -181,16 +181,28 @@ extern "C" { /* Length specific integer declarations */ +/* Handle the special/unusual cases first with everything else leveraging stdints.h */ #if defined (VMS) #include -#else -typedef signed char int8; -typedef signed short int16; -typedef signed int int32; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; -#endif +#elif defined(_MSC_VER) && (_MSC_VER < 1600) +typedef __int8 int8; +typedef __int16 int16; +typedef __int32 int32; +typedef unsigned __int8 uint8; +typedef unsigned __int16 uint16; +typedef unsigned __int32 uint32; +#else +/* All modern/standard compiler environments */ +/* any other environment needa a special case above */ +#include +typedef int8_t int8; +typedef int16_t int16; +typedef int32_t int32; +typedef uint8_t uint8; +typedef uint16_t uint16; +typedef uint32_t uint32; +#endif /* end standard integers */ + typedef int t_stat; /* status */ typedef int t_bool; /* boolean */