smeenai created this revision.
smeenai added reviewers: compnerd, EricWF, mclow.lists.
smeenai added a subscriber: cfe-commits.

Visual Studio 2013 (CRT version 12) added support for many C99 long long
and long double functions. Visual Studio 2015 (CRT version 14) increased
C99 and C11 compliance further. Since we don't support Visual Studio
versions older than 2013, we can considerably clean up the support
header.

https://reviews.llvm.org/D24314

Files:
  include/support/win32/support.h

Index: include/support/win32/support.h
===================================================================
--- include/support/win32/support.h
+++ include/support/win32/support.h
@@ -22,7 +22,7 @@
 #include <intrin.h>
 #endif
 #if defined(_LIBCPP_MSVCRT)
-#include <xlocinfo.h>
+#include <crtversion.h>
 #endif
 #define swprintf _snwprintf
 #define vswprintf _vsnwprintf
@@ -45,27 +45,11 @@
 #endif // __MINGW32__
 
 #if defined(_LIBCPP_MSVCRT)
+#if _VC_CRT_MAJOR_VERSION < 14
 #define snprintf _snprintf
-#define atoll _atoi64
-#define strtoll _strtoi64
-#define strtoull _strtoui64
-#define wcstoll _wcstoi64
-#define wcstoull _wcstoui64
-_LIBCPP_ALWAYS_INLINE float strtof(const char *nptr, char **endptr)
-{
-  return _Stof(nptr, endptr, 0);
-}
-_LIBCPP_ALWAYS_INLINE double strtod(const char *nptr, char **endptr)
-{
-  return _Stod(nptr, endptr, 0);
-}
-_LIBCPP_ALWAYS_INLINE long double strtold(const char *nptr, char **endptr)
-{
-  return _Stold(nptr, endptr, 0);
-}
-
 #define _Exit _exit
 #endif
+#endif
 
 #if defined(_LIBCPP_MSVC)
 


Index: include/support/win32/support.h
===================================================================
--- include/support/win32/support.h
+++ include/support/win32/support.h
@@ -22,7 +22,7 @@
 #include <intrin.h>
 #endif
 #if defined(_LIBCPP_MSVCRT)
-#include <xlocinfo.h>
+#include <crtversion.h>
 #endif
 #define swprintf _snwprintf
 #define vswprintf _vsnwprintf
@@ -45,27 +45,11 @@
 #endif // __MINGW32__
 
 #if defined(_LIBCPP_MSVCRT)
+#if _VC_CRT_MAJOR_VERSION < 14
 #define snprintf _snprintf
-#define atoll _atoi64
-#define strtoll _strtoi64
-#define strtoull _strtoui64
-#define wcstoll _wcstoi64
-#define wcstoull _wcstoui64
-_LIBCPP_ALWAYS_INLINE float strtof(const char *nptr, char **endptr)
-{
-  return _Stof(nptr, endptr, 0);
-}
-_LIBCPP_ALWAYS_INLINE double strtod(const char *nptr, char **endptr)
-{
-  return _Stod(nptr, endptr, 0);
-}
-_LIBCPP_ALWAYS_INLINE long double strtold(const char *nptr, char **endptr)
-{
-  return _Stold(nptr, endptr, 0);
-}
-
 #define _Exit _exit
 #endif
+#endif
 
 #if defined(_LIBCPP_MSVC)
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to