forked from HowardHinnant/date
Introduce set_install as suggested by PR 99
* Retain install variable as a function local static to maintain recent fixes to initialization order problems.
This commit is contained in:
20
tz.cpp
20
tz.cpp
@@ -215,10 +215,10 @@ namespace date
|
||||
using namespace detail;
|
||||
|
||||
static
|
||||
const std::string&
|
||||
get_install()
|
||||
std::string&
|
||||
access_install()
|
||||
{
|
||||
static const std::string install
|
||||
static std::string install
|
||||
#ifndef INSTALL
|
||||
|
||||
# ifdef _WIN32
|
||||
@@ -239,6 +239,20 @@ get_install()
|
||||
return install;
|
||||
}
|
||||
|
||||
void
|
||||
set_install(const std::string& s)
|
||||
{
|
||||
access_install() = s;
|
||||
}
|
||||
|
||||
static
|
||||
const std::string&
|
||||
get_install()
|
||||
{
|
||||
static const std::string& ref = access_install();
|
||||
return ref;
|
||||
}
|
||||
|
||||
static
|
||||
std::string
|
||||
get_download_gz_file(const std::string& version)
|
||||
|
Reference in New Issue
Block a user