mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-27 08:31:03 +08:00
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:
parent
41093d05d8
commit
634b84eb60
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user