mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-25 23:40:53 +08:00
Fix unused functions on Android
... spotted with `-Wall` Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
This commit is contained in:
parent
fca69e308d
commit
447f5a30b9
28
src/tz.cpp
28
src/tz.cpp
@ -194,9 +194,9 @@ struct index_entry_t {
|
||||
|
||||
#ifdef _WIN32
|
||||
static CONSTDATA char folder_delimiter = '\\';
|
||||
#else // !_WIN32
|
||||
#elif !defined(ANDROID) && !defined(__ANDROID__)
|
||||
static CONSTDATA char folder_delimiter = '/';
|
||||
#endif // !_WIN32
|
||||
#endif // !defined(WIN32) && !defined(ANDROID) && !defined(__ANDROID__)
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ < 5
|
||||
// GCC 4.9 Bug 61489 Wrong warning with -Wmissing-field-initializers
|
||||
@ -616,6 +616,7 @@ get_tzdb_list()
|
||||
return tz_db;
|
||||
}
|
||||
|
||||
#if !defined(ANDROID) && !defined(__ANDROID__)
|
||||
inline
|
||||
static
|
||||
char
|
||||
@ -644,6 +645,7 @@ get_alpha_word(std::istream& in)
|
||||
s.push_back(static_cast<char>(in.get()));
|
||||
return s;
|
||||
}
|
||||
#endif // !defined(ANDROID) && !defined(__ANDROID__)
|
||||
|
||||
inline
|
||||
static
|
||||
@ -654,6 +656,7 @@ is_prefix_of(std::string const& key, std::string const& value)
|
||||
return key.compare(0, size, value, 0, size) == 0;
|
||||
}
|
||||
|
||||
#if !defined(ANDROID) && !defined(__ANDROID__)
|
||||
static
|
||||
unsigned
|
||||
parse_month(std::istream& in)
|
||||
@ -673,6 +676,7 @@ parse_month(std::istream& in)
|
||||
throw std::runtime_error("oops: bad month name: " + s);
|
||||
return static_cast<unsigned>(++m);
|
||||
}
|
||||
#endif // !defined(ANDROID) && !defined(__ANDROID__)
|
||||
|
||||
#if !USE_OS_TZDB
|
||||
|
||||
@ -2895,24 +2899,14 @@ operator<<(std::ostream& os, const leap_second& x)
|
||||
|
||||
#if USE_OS_TZDB
|
||||
|
||||
#if !defined(ANDROID) && !defined(__ANDROID__)
|
||||
static
|
||||
std::string
|
||||
get_version()
|
||||
{
|
||||
using namespace std;
|
||||
#if defined(ANDROID) || defined(__ANDROID__)
|
||||
auto path = get_tz_dir() + string("/tzdata");
|
||||
ifstream in{path};
|
||||
bionic_tzdata_header_t hdr{};
|
||||
if (in)
|
||||
{
|
||||
in.read(reinterpret_cast<char*>(&hdr), sizeof(bionic_tzdata_header_t));
|
||||
return string(hdr.tzdata_version).replace(0, 6, "");
|
||||
}
|
||||
#else
|
||||
auto path = get_tz_dir() + string("/+VERSION");
|
||||
ifstream in{path};
|
||||
string version;
|
||||
auto path = get_tz_dir() + std::string("/+VERSION");
|
||||
std::ifstream in{path};
|
||||
std::string version;
|
||||
if (in)
|
||||
{
|
||||
in >> version;
|
||||
@ -2925,11 +2919,9 @@ get_version()
|
||||
in >> version;
|
||||
return version;
|
||||
}
|
||||
#endif // defined(ANDROID) || defined(__ANDROID__)
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
#if !defined(ANDROID) && !defined(__ANDROID__)
|
||||
static
|
||||
std::vector<leap_second>
|
||||
find_read_and_leap_seconds()
|
||||
|
Loading…
x
Reference in New Issue
Block a user