diff --git a/ChangeLog b/ChangeLog index e68d613..be5f8ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015.134: 2.16m + - Add defines for needed integer types and macros from inttypes.h + missing in older MSVC versions. MSVC 2010 and later appear to have + enough C99 support. + - Add define tests for _WIN32 and _WIN64 to cover all WINs. + - ms_fread(): Add cast to quiet warning for conversion from size_t + to int. In this case the read will always be <= MAXRECLEN, much + smaller than int, making the conversion safe. + 2015.113: 2.16 - Update minor release version in Makefile. diff --git a/fileutils.c b/fileutils.c index af1a9cb..f9d947a 100644 --- a/fileutils.c +++ b/fileutils.c @@ -976,7 +976,7 @@ ms_fread (char *buf, int size, int num, FILE *stream) { int read = 0; - read = fread (buf, size, num, stream); + read = (int) fread (buf, size, num, stream); if ( read <= 0 && size && num ) { diff --git a/libmseed.h b/libmseed.h index 9b7d064..867f343 100644 --- a/libmseed.h +++ b/libmseed.h @@ -30,8 +30,8 @@ extern "C" { #include "lmplatform.h" -#define LIBMSEED_VERSION "2.16" -#define LIBMSEED_RELEASE "2015.113" +#define LIBMSEED_VERSION "2.16m" +#define LIBMSEED_RELEASE "2015.134" #define MINRECLEN 128 /* Minimum Mini-SEED record length, 2^7 bytes */ /* Note: the SEED specification minimum is 256 */ diff --git a/lmplatform.h b/lmplatform.h index ac571f0..60d3377 100644 --- a/lmplatform.h +++ b/lmplatform.h @@ -18,7 +18,7 @@ * * Written by Chad Trabant, IRIS Data Management Center * - * modified: 2015.108 + * modified: 2015.134 ***************************************************************************/ #ifndef LMPLATFORM_H @@ -48,7 +48,6 @@ extern "C" { #include #include #include -#include #include #include #include @@ -59,25 +58,49 @@ extern "C" { #define LMP_GLIBC2 1 /* Deprecated */ #include + #include #elif defined(__sun__) || defined(__sun) #define LMP_SOLARIS 1 #include + #include #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) #define LMP_BSD 1 #include + #include -#elif defined(WIN32) || defined(WIN64) +#elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) #define LMP_WIN 1 #define LMP_WIN32 1 /* Deprecated */ #include #include + /* For pre-MSVC 2010 define standard int types, otherwise use inttypes.h */ + #if defined(_MSC_VER) && _MSC_VER < 1600 + typedef signed char int8_t; + typedef unsigned char uint8_t; + typedef signed short int int16_t; + typedef unsigned short int uint16_t; + typedef signed int int32_t; + typedef unsigned int uint32_t; + typedef signed __int64 int64_t; + typedef unsigned __int64 uint64_t; + #else + #include + #endif + #if defined(_MSC_VER) + #if !defined(PRId64) + #define PRId64 "I64d" + #endif + #if !defined(SCNd64) + #define SCNd64 "I64d" + #endif + #define snprintf _snprintf #define vsnprintf _vsnprintf #define strcasecmp _stricmp