summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorBruce Dawson <brucedawson@google.com>2015-04-09 11:10:17 -0700
committerBruce Dawson <brucedawson@google.com>2015-04-09 11:10:17 -0700
commit06e015f33248e4453259c8cebc414e9601638a6d (patch)
treeca2a151f6163098ea6f66c674b75b573b06c7e6f /fpdfsdk
parente081aa0ffc57b70b8ff6581e956617f898c7b9e0 (diff)
downloadpdfium-06e015f33248e4453259c8cebc414e9601638a6d.tar.xz
Merge to XFA: Fix ref 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. Merged from change https://codereview.chromium.org/1075673002 TBR=tsepez@chromium.org BUG=440500 Review URL: https://codereview.chromium.org/1077773002
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/src/jsapi/fxjs_v8.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index 72966e9c63..2b77766b7a 100644
--- a/fpdfsdk/src/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp
@@ -761,6 +761,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));
}