summaryrefslogtreecommitdiffstats
path: root/src/H5win32defs.h
diff options
context:
space:
mode:
authorderobins <dana.e.robinson@gmail.com>2016-12-02 05:51:07 (GMT)
committerderobins <dana.e.robinson@gmail.com>2016-12-02 05:51:07 (GMT)
commit0c5f56a865725f1e5aaf14704ebcb0704e07bb59 (patch)
treeb2cf16485484089abda346f0739ddcc53895f79a /src/H5win32defs.h
parent63bcd73f1f53a8b4bb31083cbc30f9a90663438f (diff)
downloadhdf5-0c5f56a865725f1e5aaf14704ebcb0704e07bb59.zip
hdf5-0c5f56a865725f1e5aaf14704ebcb0704e07bb59.tar.gz
hdf5-0c5f56a865725f1e5aaf14704ebcb0704e07bb59.tar.bz2
Added Windows-only versions of the round() functions, which do not
exist in VS2012 and earlier. Tested on: 32-bit Windows 7 w/ VS2012 Pro
Diffstat (limited to 'src/H5win32defs.h')
-rw-r--r--src/H5win32defs.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/H5win32defs.h b/src/H5win32defs.h
index 662b97b..4124c71 100644
--- a/src/H5win32defs.h
+++ b/src/H5win32defs.h
@@ -75,11 +75,21 @@ struct timezone {
#if (_MSC_VER < 1900)
struct timespec
{
- time_t tv_sec; // Seconds - >= 0
- long tv_nsec; // Nanoseconds - [0, 999999999]
+ time_t tv_sec; // Seconds - >= 0
+ long tv_nsec; // Nanoseconds - [0, 999999999]
};
#endif /* MSC_VER < 1900 */
+/* The round functions do not exist in VS2012 and earlier */
+#if (_MSC_VER <= 1700)
+#define HDllround(V) Wllround(V)
+#define HDllroundf(V) Wllroundf(V)
+#define HDlround(V) Wlround(V)
+#define HDlroundf(V) Wlroundf(V)
+#define HDround(V) Wround(V)
+#define HDroundf(V) Wroundf(V)
+#endif /* MSC_VER < 1700 */
+
#endif /* H5_HAVE_VISUAL_STUDIO */
@@ -92,6 +102,18 @@ extern "C" {
H5_DLL char* Wgetlogin(void);
H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...);
H5_DLL int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap);
+
+ /* Round functions only needed for VS2012 and earlier.
+ * They are always built to ensure they don't go stale and
+ * can be deleted (along with their #defines, above) when we
+ * drop VS2012 support.
+ */
+ H5_DLL long long Wllround(double arg);
+ H5_DLL long long Wllroundf(float arg);
+ H5_DLL long Wlround(double arg);
+ H5_DLL long Wlroundf(float arg);
+ H5_DLL double Wround(double arg);
+ H5_DLL float Wroundf(float arg);
#ifdef __cplusplus
}
#endif /* __cplusplus */