From 9fb5e05ebaf1ad457d1993c8eb04f8a433e784b7 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 16 Jun 2016 22:04:31 -0400 Subject: [PATCH] HAS_REMOTE_API support for Windows. Adds support for MingW too. * HAS_REMOTE_API still defaults to 0 * When HAS_REMOTE_API=0 only libraries advapi32.lib, ole32.lib and shell32.lib are required. * Setting HAS_REMOTE_API=1 requires curl: https://curl.haxx.se/libcurl/ *- Also need to manually install 7-Zip (http://www.7-zip.org). *- Will automatically install Tinyxml2 (http://www.grinninglizard.com/tinyxml2/). *- Will automatically install http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml --- tz.html | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/tz.html b/tz.html index 815fe8d..cd9a1e0 100644 --- a/tz.html +++ b/tz.html @@ -26,7 +26,7 @@

Howard E. Hinnant
-2016-06-08
+2016-06-16

Time Zone Database Parser

@@ -2914,15 +2914,16 @@ contains the following string near the top:

-static std::string install{"~/Downloads/tzdata"};  //  "c:\\tzdata" on Windows
+static std::string install{"~/Downloads/tzdata"};  //  "c:\%homedrive%\%homepath%\downloads\tzdata" on Windows
 

-You should set this such that install points to the directory -where your library or application can find the downloaded and uncompressed -IANA Time Zone Database (or where -you want the software to install it for you if you compile with -AUTO_DOWNLOAD == 1). +You should set this such that install points to the directory where your +library or application can find the downloaded and uncompressed IANA Time Zone Database -- tzdataYYYYv.tar.gz +(or where you want the software to install it for you if you compile with +AUTO_DOWNLOAD == 1). On Windows a utility such as +7-zip can be used to decompress the database.

@@ -2972,6 +2973,40 @@ it if it hasn't been installed, and if it has, will use the remote API to instal latest version if not already installed.

+

Windows specific:

+ +

+If you want to enable HAS_REMOTE_API and/or AUTO_DOWNLOAD on +Windows you will have to manually install +curl and +7-zip into their default locations. +

+ +

+If you do not enable HAS_REMOTE_API, you will need to also install + +http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml into your +install location. This will be done for you if you have enabled +HAS_REMOTE_API and let AUTO_DOWNLOAD default to 1. +

+ +

+To enable HAS_REMOTE_API you can either edit tz.h, adding: +

+ +
+#define HAS_REMOTE_API 1
+
+ +

+Or you can put /DHAS_REMOTE_API=1 on the command line. When +HAS_REMOTE_API == 1, AUTO_DOWNLOAD defaults to 1. +

+ +

+mingw users: -lpthread is required. +

+

Optional installation tweaks