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;
|
using namespace detail;
|
||||||
|
|
||||||
static
|
static
|
||||||
const std::string&
|
std::string&
|
||||||
get_install()
|
access_install()
|
||||||
{
|
{
|
||||||
static const std::string install
|
static std::string install
|
||||||
#ifndef INSTALL
|
#ifndef INSTALL
|
||||||
|
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
@ -239,6 +239,20 @@ get_install()
|
|||||||
return 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
|
static
|
||||||
std::string
|
std::string
|
||||||
get_download_gz_file(const std::string& version)
|
get_download_gz_file(const std::string& version)
|
||||||
|
1
tz.h
1
tz.h
@ -767,6 +767,7 @@ operator<<(std::ostream& os, const TZ_DB& db);
|
|||||||
|
|
||||||
DATE_API const TZ_DB& get_tzdb();
|
DATE_API const TZ_DB& get_tzdb();
|
||||||
DATE_API const TZ_DB& reload_tzdb();
|
DATE_API const TZ_DB& reload_tzdb();
|
||||||
|
DATE_API void set_install(const std::string& install);
|
||||||
|
|
||||||
#if HAS_REMOTE_API
|
#if HAS_REMOTE_API
|
||||||
DATE_API std::string remote_version();
|
DATE_API std::string remote_version();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user