Enforce recent VC++ version (2015 or later).

Remove ifdef'd code for versions we know will no longer work.

Change-Id: I036c80168f846df1b98e9df4972f84655e8418fb
Reviewed-on: https://pdfium-review.googlesource.com/10051
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxcrt/fx_basic_util.cpp b/core/fxcrt/fx_basic_util.cpp
index 9491e36..194f6d7 100644
--- a/core/fxcrt/fx_basic_util.cpp
+++ b/core/fxcrt/fx_basic_util.cpp
@@ -127,24 +127,6 @@
   return FX_atof(FX_UTF8Encode(wsStr).c_str());
 }
 
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
-void FXSYS_snprintf(char* str,
-                    size_t size,
-                    _Printf_format_string_ const char* fmt,
-                    ...) {
-  va_list ap;
-  va_start(ap, fmt);
-  FXSYS_vsnprintf(str, size, fmt, ap);
-  va_end(ap);
-}
-
-void FXSYS_vsnprintf(char* str, size_t size, const char* fmt, va_list ap) {
-  (void)_vsnprintf(str, size, fmt, ap);
-  if (size)
-    str[size - 1] = 0;
-}
-#endif  // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
-
 FX_FileHandle* FX_OpenFolder(const char* path) {
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
   auto pData = pdfium::MakeUnique<CFindFileDataA>();
diff --git a/core/fxcrt/fx_system.h b/core/fxcrt/fx_system.h
index a3dc21b..47d588c 100644
--- a/core/fxcrt/fx_system.h
+++ b/core/fxcrt/fx_system.h
@@ -53,6 +53,10 @@
 #error Sorry, can not figure out target OS. Please specify _FX_OS_ macro.
 #endif
 
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#error Sorry, VC++ 2015 or later is required to compile PDFium.
+#endif  // defined(_MSC_VER) && _MSC_VER < 1900
+
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
 #include <windows.h>
 #include <sal.h>
@@ -106,19 +110,9 @@
 #define FX_BEZIER 0.5522847498308f
 
 // NOTE: prevent use of the return value from snprintf() since some platforms
-// have different return values (e.g. windows _vsnprintf()), and provide
-// versions that always NUL-terminate.
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
-void FXSYS_snprintf(char* str,
-                    size_t size,
-                    _Printf_format_string_ const char* fmt,
-                    ...);
-void FXSYS_vsnprintf(char* str, size_t size, const char* fmt, va_list ap);
-#else  // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
+// have different return values.
 #define FXSYS_snprintf (void)snprintf
 #define FXSYS_vsnprintf (void)vsnprintf
-#endif  // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
-
 #define FXSYS_sprintf DO_NOT_USE_SPRINTF_DIE_DIE_DIE
 #define FXSYS_vsprintf DO_NOT_USE_VSPRINTF_DIE_DIE_DIE
 
diff --git a/core/fxge/win32/dwrite_int.h b/core/fxge/win32/dwrite_int.h
index 16be7b7..2d1deb6 100644
--- a/core/fxge/win32/dwrite_int.h
+++ b/core/fxge/win32/dwrite_int.h
@@ -12,14 +12,14 @@
 #include "core/fxge/fx_dib.h"
 
 #ifndef DECLSPEC_UUID
-#if (_MSC_VER >= 1100) && defined(__cplusplus)
+#if defined(__cplusplus)
 #define DECLSPEC_UUID(x) __declspec(uuid(x))
 #else
 #define DECLSPEC_UUID(x)
 #endif
 #endif
 #ifndef DECLSPEC_NOVTABLE
-#if (_MSC_VER >= 1100) && defined(__cplusplus)
+#if defined(__cplusplus)
 #define DECLSPEC_NOVTABLE __declspec(novtable)
 #else
 #define DECLSPEC_NOVTABLE
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp
index 1b8f7f1..184ff82 100644
--- a/fpdfsdk/javascript/JS_Value.cpp
+++ b/fpdfsdk/javascript/JS_Value.cpp
@@ -37,10 +37,9 @@
   time_t t = 0;
   time(&t);
   localtime(&t);
-#if _MSC_VER >= 1900
-  // In gcc and in Visual Studio prior to VS 2015 'timezone' is a global
-  // variable declared in time.h. That variable was deprecated and in VS 2015
-  // is removed, with _get_timezone replacing it.
+#if defined(_MSC_VER)
+  // In gcc 'timezone' is a global variable declared in time.h. In VC++, that
+  // variable was removed in VC++ 2015, with _get_timezone replacing it.
   long timezone = 0;
   _get_timezone(&timezone);
 #endif
@@ -68,7 +67,7 @@
 }
 
 int IsFinite(double v) {
-#if _MSC_VER
+#if defined(_MSC_VER)
   return ::_finite(v);
 #else
   return std::fabs(v) < std::numeric_limits<double>::max();