11
11
* help@hdfgroup.org. *
12
12
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13
13
14
- /* Programmer: Scott Wegner
15
- * June 3, 2008
16
- *
17
- * Purpose: This file is used to map HDF macros to Windows functions. This
14
+ /* Purpose: This file is used to map HDF macros to Windows functions. This
18
15
* should get included H5private mappings, so as to override them.
19
16
* Any macro not mapped here, however, will receive a similar mapping
20
17
* inside H5private.h
21
18
*
22
19
*/
23
- #ifndef H5_HAVE_INTTYPES_H
24
- /* The following definitions should be suitable for 64-bit Windows, which is
25
- * LLP64, and for 32-bit Windows, which is ILP32. Those are the only
26
- * platforms where <inttypes.h> is likely to be missing. VS2015 and later
27
- * *may* provide these definitions.
28
- */
29
- #ifdef _WIN64
30
- #define PRIdPTR "lld"
31
- #define PRIoPTR "llo"
32
- #define PRIuPTR "llu"
33
- #define PRIxPTR "llx"
34
- #define PRIXPTR "llX"
35
- #else /* _WIN64 */
36
- #define PRIdPTR "ld"
37
- #define PRIoPTR "lo"
38
- #define PRIuPTR "lu"
39
- #define PRIxPTR "lx"
40
- #define PRIXPTR "lX"
41
- #endif /* _WIN64 */
42
-
43
- #define PRId8 "d"
44
- #define PRIo8 "o"
45
- #define PRIu8 "u"
46
- #define PRIx8 "x"
47
- #define PRIX8 "X"
48
- #define PRId16 "d"
49
- #define PRIo16 "o"
50
- #define PRIu16 "u"
51
- #define PRIx16 "x"
52
- #define PRIX16 "X"
53
- #define PRId32 "d"
54
- #define PRIo32 "o"
55
- #define PRIu32 "u"
56
- #define PRIx32 "x"
57
- #define PRIX32 "X"
58
- #define PRId64 "lld"
59
- #define PRIo64 "llo"
60
- #define PRIu64 "llu"
61
- #define PRIx64 "llx"
62
- #define PRIX64 "llX"
63
- #define PRIdMAX "lld"
64
- #define PRIoMAX "llo"
65
- #define PRIuMAX "llu"
66
- #define PRIxMAX "llx"
67
- #define PRIXMAX "llX"
68
- #endif
69
20
70
- /*
71
- * _MSC_VER = 1900 VS2015
72
- * _MSC_VER = 1800 VS2013
73
- * _MSC_VER = 1700 VS2012
21
+ /* _MSC_VER = 192x VS2019
22
+ * _MSC_VER = 191x VS2017
23
+ * _MSC_VER = 1900 VS2015
24
+ * _MSC_VER = 1800 VS2013
25
+ * _MSC_VER = 1700 VS2012
74
26
*/
75
27
#ifdef H5_HAVE_WIN32_API
76
28
@@ -119,22 +71,8 @@ typedef __int64 h5_stat_size_t;
119
71
120
72
#ifdef H5_HAVE_VISUAL_STUDIO
121
73
122
- #if (_MSC_VER < 1800 )
123
- #ifndef H5_HAVE_STRTOLL
124
- #define HDstrtoll (S , R , N ) _strtoi64(S, R, N)
125
- #endif /* H5_HAVE_STRTOLL */
126
- #ifndef H5_HAVE_STRTOULL
127
- #define HDstrtoull (S , R , N ) _strtoui64(S, R, N)
128
- #endif /* H5_HAVE_STRTOULL */
129
- /* va_copy() does not exist on pre-2013 Visual Studio. Since va_lists are
130
- * just pointers into the stack in those CRTs, the usual work-around
131
- * is to just define the operation as a pointer copy.
132
- */
133
- #define HDva_copy (D , S ) ((D) = (S))
134
- #endif /* MSC_VER < 1800 */
135
-
136
74
/*
137
- * The (void*) cast just avoids a compiler warning in H5_HAVE_VISUAL_STUDIO
75
+ * The (void*) cast just avoids a compiler warning in MSVC
138
76
*/
139
77
#define HDmemset (X , C , Z ) memset((void *)(X), C, Z)
140
78
@@ -143,26 +81,6 @@ struct timezone {
143
81
int tz_dsttime ;
144
82
};
145
83
146
- /* time.h before VS2015 does not include timespec */
147
- #if (_MSC_VER < 1900 )
148
- struct timespec {
149
- time_t tv_sec ; /* Seconds - >= 0 */
150
- long tv_nsec ; /* Nanoseconds - [0, 999999999] */
151
- };
152
- #endif /* MSC_VER < 1900 */
153
-
154
- #if (_MSC_VER <= 1700 )
155
- /* The isnan function needs underscore in VS2012 and earlier */
156
- #define HDisnan (X ) _isnan(X)
157
- /* The round functions do not exist in VS2012 and earlier */
158
- #define HDllround (V ) Wllround(V)
159
- #define HDllroundf (V ) Wllroundf(V)
160
- #define HDlround (V ) Wlround(V)
161
- #define HDlroundf (V ) Wlroundf(V)
162
- #define HDround (V ) Wround(V)
163
- #define HDroundf (V ) Wroundf(V)
164
- #endif /* MSC_VER < 1700 */
165
-
166
84
#endif /* H5_HAVE_VISUAL_STUDIO */
167
85
168
86
#ifdef __cplusplus
@@ -172,25 +90,11 @@ H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz);
172
90
H5_DLL int Wsetenv (const char * name , const char * value , int overwrite );
173
91
H5_DLL int Wflock (int fd , int operation );
174
92
H5_DLL char * Wgetlogin (void );
175
- H5_DLL int c99_snprintf (char * str , size_t size , const char * format , ...);
176
- H5_DLL int c99_vsnprintf (char * str , size_t size , const char * format , va_list ap );
177
93
H5_DLL herr_t H5_expand_windows_env_vars (char * * env_var );
178
94
H5_DLL wchar_t * H5_get_utf16_str (const char * s );
179
95
H5_DLL int Wopen_utf8 (const char * path , int oflag , ...);
180
96
H5_DLL int Wremove_utf8 (const char * path );
181
97
H5_DLL int H5_get_win32_times (H5_timevals_t * tvs );
182
-
183
- /* Round functions only needed for VS2012 and earlier.
184
- * They are always built to ensure they don't go stale and
185
- * can be deleted (along with their #defines, above) when we
186
- * drop VS2012 support.
187
- */
188
- H5_DLL long long Wllround (double arg );
189
- H5_DLL long long Wllroundf (float arg );
190
- H5_DLL long Wlround (double arg );
191
- H5_DLL long Wlroundf (float arg );
192
- H5_DLL double Wround (double arg );
193
- H5_DLL float Wroundf (float arg );
194
98
#ifdef __cplusplus
195
99
}
196
100
#endif /* __cplusplus */
@@ -199,8 +103,6 @@ H5_DLL float Wroundf(float arg);
199
103
#define HDsetenv (N , V , O ) Wsetenv(N, V, O)
200
104
#define HDflock (F , L ) Wflock(F, L)
201
105
#define HDgetlogin () Wgetlogin()
202
- #define HDsnprintf c99_snprintf /*varargs*/
203
- #define HDvsnprintf c99_vsnprintf /*varargs*/
204
106
205
107
/* Non-POSIX functions */
206
108
0 commit comments