diff options
-rw-r--r-- | src/H5system.c | 78 | ||||
-rw-r--r-- | src/H5win32defs.h | 51 |
2 files changed, 2 insertions, 127 deletions
diff --git a/src/H5system.c b/src/H5system.c index 1fd6324..1ece733 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -960,38 +960,14 @@ Wgetlogin(void) { #ifdef H5_HAVE_WINSOCK2_H - long bufferCount = WloginBuffer_count; - if (GetUserName(Wlogin_buffer, &bufferCount) == 0) + DWORD bufferCount = WloginBuffer_count; + if (GetUserName(Wlogin_buffer, &bufferCount) != 0) return (Wlogin_buffer); else #endif /* H5_HAVE_WINSOCK2_H */ return NULL; } -int c99_snprintf(char* str, size_t size, const char* format, ...) -{ - int count; - va_list ap; - - HDva_start(ap, format); - count = c99_vsnprintf(str, size, format, ap); - HDva_end(ap); - - return count; -} - -int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap) -{ - int count = -1; - - if (size != 0) - count = _vsnprintf_s(str, size, _TRUNCATE, format, ap); - if (count == -1) - count = _vscprintf(format, ap); - - return count; -} - /*------------------------------------------------------------------------- * Function: Wflock @@ -1040,56 +1016,6 @@ Wflock(int fd, int operation) { return 0; } /* end Wflock() */ - -/*------------------------------------------------------------------------- - * Function: Wllround, Wllroundf, Wlround, Wlroundf, Wround, Wroundf - * - * Purpose: Wrapper function for round functions for use with VS2012 - * and earlier. - * - * Return: The rounded value that was passed in. - * - * Programmer: Dana Robinson - * December 2016 - * - *------------------------------------------------------------------------- - */ -long long -Wllround(double arg) -{ - return (long long)(arg < 0.0 ? HDceil(arg - 0.5) : HDfloor(arg + 0.5)); -} - -long long -Wllroundf(float arg) -{ - return (long long)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F)); -} - -long -Wlround(double arg) -{ - return (long)(arg < 0.0 ? HDceil(arg - 0.5) : HDfloor(arg + 0.5)); -} - -long -Wlroundf(float arg) -{ - return (long)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F)); -} - -double -Wround(double arg) -{ - return arg < 0.0 ? HDceil(arg - 0.5) : HDfloor(arg + 0.5); -} - -float -Wroundf(float arg) -{ - return (float)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F)); -} - /*------------------------------------------------------------------------- * Function: H5_get_utf16_str * diff --git a/src/H5win32defs.h b/src/H5win32defs.h index ab3acb9..0296a54 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -111,20 +111,6 @@ typedef __int64 h5_stat_size_t; #ifdef H5_HAVE_VISUAL_STUDIO -#if (_MSC_VER < 1800) - #ifndef H5_HAVE_STRTOLL - #define HDstrtoll(S,R,N) _strtoi64(S,R,N) - #endif /* H5_HAVE_STRTOLL */ - #ifndef H5_HAVE_STRTOULL - #define HDstrtoull(S,R,N) _strtoui64(S,R,N) - #endif /* H5_HAVE_STRTOULL */ - /* va_copy() does not exist on pre-2013 Visual Studio. Since va_lists are - * just pointers into the stack in those CRTs, the usual work-around - * is to just define the operation as a pointer copy. - */ - #define HDva_copy(D,S) ((D) = (S)) -#endif /* MSC_VER < 1800 */ - /* * The (void*) cast just avoids a compiler warning in H5_HAVE_VISUAL_STUDIO */ @@ -135,27 +121,6 @@ struct timezone { int tz_dsttime; }; -/* time.h before VS2015 does not include timespec */ -#if (_MSC_VER < 1900) -struct timespec -{ - time_t tv_sec; /* Seconds - >= 0 */ - long tv_nsec; /* Nanoseconds - [0, 999999999] */ -}; -#endif /* MSC_VER < 1900 */ - -#if (_MSC_VER <= 1700) -/* The isnan function needs underscore in VS2012 and earlier */ -#define HDisnan(X) _isnan(X) -/* The round functions do not exist in VS2012 and earlier */ -#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 */ @@ -166,25 +131,11 @@ extern "C" { H5_DLL int Wsetenv(const char *name, const char *value, int overwrite); H5_DLL int Wflock(int fd, int operation); 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); H5_DLL herr_t H5_expand_windows_env_vars(char **env_var); H5_DLL const wchar_t *H5_get_utf16_str(const char *s); H5_DLL int Wopen_utf8(const char *path, int oflag, ...); H5_DLL int Wremove_utf8(const char *path); H5_DLL int H5_get_win32_times(H5_timevals_t* tvs); - - /* 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 */ @@ -193,8 +144,6 @@ extern "C" { #define HDsetenv(N,V,O) Wsetenv(N,V,O) #define HDflock(F,L) Wflock(F,L) #define HDgetlogin() Wgetlogin() -#define HDsnprintf c99_snprintf /*varargs*/ -#define HDvsnprintf c99_vsnprintf /*varargs*/ /* Non-POSIX functions */ |