20 #ifndef _tds_sysdep_public_h_
21 #define _tds_sysdep_public_h_
28 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
30 #elif defined(__sun) && defined(__SVR4)
31 # include <inttypes.h>
33 typedef signed char int8_t;
34 typedef unsigned char uint8_t;
38 # if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
39 # include <winsock2.h>
40 # include <ws2tcpip.h>
42 typedef signed short int16_t;
43 typedef unsigned short uint16_t;
44 typedef signed int int32_t;
45 typedef unsigned int uint32_t;
46 typedef signed __int64 int64_t;
47 typedef unsigned __int64 uint64_t;
48 # if !defined(WIN64) && !defined(_WIN64)
49 typedef signed int intptr_t;
50 typedef unsigned int uintptr_t;
52 typedef signed __int64 intptr_t;
53 typedef unsigned __int64 uintptr_t;
56 typedef signed short int16_t;
57 typedef unsigned short uint16_t;
58 typedef signed int int32_t;
59 typedef unsigned int uint32_t;
60 typedef signed long long int64_t;
61 typedef unsigned long long uint64_t;
62 typedef signed int intptr_t;
63 typedef unsigned int uintptr_t;
71 # if FLT_MANT_DIG == 24 && FLT_MAX_EXP == 128
72 # define tds_sysdep_real32_type float
73 # elif DBL_MANT_DIG == 24 && DBL_MAX_EXP == 128
74 # define tds_sysdep_real32_type double
75 # elif LDBL_MANT_DIG == 24 && LDBL_MAX_EXP == 128
76 # define tds_sysdep_real32_type long double
78 # if FLT_MANT_DIG == 53 && FLT_MAX_EXP == 1024
79 # define tds_sysdep_real64_type float
80 # elif DBL_MANT_DIG == 53 && DBL_MAX_EXP == 1024
81 # define tds_sysdep_real64_type double
82 # elif LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
83 # define tds_sysdep_real64_type long double
85 # if !defined(tds_sysdep_real32_type) || !defined(tds_sysdep_real64_type)
86 # error Some float type was not found!
89 # if FLT_DIG == 6 && FLT_MAX_10_EXP == 38
90 # define tds_sysdep_real32_type float
91 # elif DBL_DIG == 6 && DBL_MAX_10_EXP == 38
92 # define tds_sysdep_real32_type double
93 # elif LDBL_DIG == 6 && LDBL_MAX_10_EXP == 38
94 # define tds_sysdep_real32_type long double
96 # if FLT_DIG == 15 && FLT_MAX_10_EXP == 308
97 # define tds_sysdep_real64_type float
98 # elif DBL_DIG == 15 && DBL_MAX_10_EXP == 308
99 # define tds_sysdep_real64_type double
100 # elif LDBL_DIG == 15 && LDBL_MAX_10_EXP == 308
101 # define tds_sysdep_real64_type long double
106 #ifndef tds_sysdep_real32_type
107 #define tds_sysdep_real32_type float
110 #ifndef tds_sysdep_real64_type
111 #define tds_sysdep_real64_type double
114 #if !defined(MSDBLIB) && !defined(SYBDBLIB)
117 #if defined(MSDBLIB) && defined(SYBDBLIB)
118 #error MSDBLIB and SYBDBLIB cannot both be defined