From cbcc7305fd8d0d0fbed316ed092642de10c3b207 Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Thu, 9 Apr 2015 09:36:34 -0700 Subject: Fix reference to timezone variable - removed in VS 2015 It turns out that 'timezone' has been deprecated for a while. If deprecation messages are enabled then VS 2013 says this when 'timezone' is referenced: warning C4996: 'timezone': This function or variable may be unsafe. Consider using _get_timezone instead. Sometimes features stay deprecated for decades, but in this case 'timezone' is now gone. R=tsepez@chromium.org BUG=440500 Review URL: https://codereview.chromium.org/1075673002 --- fpdfsdk/src/jsapi/fxjs_v8.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index edade5fb94..1fb2a0882f 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -758,6 +758,13 @@ double _getLocalTZA() 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. + long timezone = 0; + _get_timezone(&timezone); +#endif return (double)(-(timezone * 1000)); } -- cgit v1.2.3