[PATCH 41/50] [common] Windows int MIN and MAX Definititions


Michael Schonberg <mschonberg@...>
 

From: Mike Schonberg <mschonberg@nyx.com>

Also moved 8 byte integer typedefs to wombat/strutils with the other similiar
typedefs.

Signed-off-by: Mike Schonberg <mschonberg@nyx.com>
---
common/c_cpp/src/c/linux/port.h | 4 ---
common/c_cpp/src/c/windows/port.h | 36 ++++++++++++++++++++++++++++++++++
common/c_cpp/src/c/wombat/strutils.h | 2 +
3 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/common/c_cpp/src/c/linux/port.h b/common/c_cpp/src/c/linux/port.h
index 67ae0c9..b40b4fa 100644
--- a/common/c_cpp/src/c/linux/port.h
+++ b/common/c_cpp/src/c/linux/port.h
@@ -67,10 +67,6 @@ typedef void* LIB_HANDLE;
/* suffix for shared libraries */
#define LIB_EXTENSION ".so"

-/* 8 byte int typedefs */
-typedef unsigned long long int w_u64_t;
-typedef long long int w_i64_t;
-
/* Network conversion function */
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htonll(x) \
diff --git a/common/c_cpp/src/c/windows/port.h b/common/c_cpp/src/c/windows/port.h
index ded944a..ac35348 100644
--- a/common/c_cpp/src/c/windows/port.h
+++ b/common/c_cpp/src/c/windows/port.h
@@ -174,6 +174,42 @@ const char *index( const char *str, char c );
*/
#define PRId64 "I64d"
#define PRIu64 "I64u"
+#ifndef INT8_MIN
+#define INT8_MIN SCHAR_MIN
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX SCHAR_MAX
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN SHRT_MIN
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX SHRT_MAX
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN INT_MIN
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX INT_MAX
+#endif
+#ifndef INT64_MIN
+#define INT64_MIN LLONG_MIN
+#endif
+#ifndef INT64_MAX
+#define INT64_MAX LLONG_MAX
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX UCHAR_MAX
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX USHRT_MAX
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX UINT_MAX
+#endif
+#ifndef UINT64_MAX
+#define UINT64_MAX ULLONG_MAX
+#endif

#define wthread_detach( h ) /* noop */
#define wthread_self GetCurrentThread
diff --git a/common/c_cpp/src/c/wombat/strutils.h b/common/c_cpp/src/c/wombat/strutils.h
index d5d1fb8..be7da86 100644
--- a/common/c_cpp/src/c/wombat/strutils.h
+++ b/common/c_cpp/src/c/wombat/strutils.h
@@ -33,6 +33,8 @@ typedef unsigned long int w_u32_t;
typedef long int w_i32_t;
typedef float w_f32_t;
typedef double w_f64_t;
+typedef unsigned long long int w_u64_t;
+typedef long long int w_i64_t;

COMMONExpDLL
int wmFastCopyAndShiftStr (
--
1.7.7.6