mirror of
https://github.com/HowardHinnant/date.git
synced 2025-01-13 17:34:45 +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
|
#ifdef _WIN32
|
||||||
static CONSTDATA char folder_delimiter = '\\';
|
static CONSTDATA char folder_delimiter = '\\';
|
||||||
#else // !_WIN32
|
#elif !defined(ANDROID) && !defined(__ANDROID__)
|
||||||
static CONSTDATA char folder_delimiter = '/';
|
static CONSTDATA char folder_delimiter = '/';
|
||||||
#endif // !_WIN32
|
#endif // !defined(WIN32) && !defined(ANDROID) && !defined(__ANDROID__)
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ < 5
|
#if defined(__GNUC__) && __GNUC__ < 5
|
||||||
// GCC 4.9 Bug 61489 Wrong warning with -Wmissing-field-initializers
|
// GCC 4.9 Bug 61489 Wrong warning with -Wmissing-field-initializers
|
||||||
@ -616,6 +616,7 @@ get_tzdb_list()
|
|||||||
return tz_db;
|
return tz_db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(ANDROID) && !defined(__ANDROID__)
|
||||||
inline
|
inline
|
||||||
static
|
static
|
||||||
char
|
char
|
||||||
@ -644,6 +645,7 @@ get_alpha_word(std::istream& in)
|
|||||||
s.push_back(static_cast<char>(in.get()));
|
s.push_back(static_cast<char>(in.get()));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
#endif // !defined(ANDROID) && !defined(__ANDROID__)
|
||||||
|
|
||||||
inline
|
inline
|
||||||
static
|
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;
|
return key.compare(0, size, value, 0, size) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(ANDROID) && !defined(__ANDROID__)
|
||||||
static
|
static
|
||||||
unsigned
|
unsigned
|
||||||
parse_month(std::istream& in)
|
parse_month(std::istream& in)
|
||||||
@ -673,6 +676,7 @@ parse_month(std::istream& in)
|
|||||||
throw std::runtime_error("oops: bad month name: " + s);
|
throw std::runtime_error("oops: bad month name: " + s);
|
||||||
return static_cast<unsigned>(++m);
|
return static_cast<unsigned>(++m);
|
||||||
}
|
}
|
||||||
|
#endif // !defined(ANDROID) && !defined(__ANDROID__)
|
||||||
|
|
||||||
#if !USE_OS_TZDB
|
#if !USE_OS_TZDB
|
||||||
|
|
||||||
@ -2895,24 +2899,14 @@ operator<<(std::ostream& os, const leap_second& x)
|
|||||||
|
|
||||||
#if USE_OS_TZDB
|
#if USE_OS_TZDB
|
||||||
|
|
||||||
|
#if !defined(ANDROID) && !defined(__ANDROID__)
|
||||||
static
|
static
|
||||||
std::string
|
std::string
|
||||||
get_version()
|
get_version()
|
||||||
{
|
{
|
||||||
using namespace std;
|
auto path = get_tz_dir() + std::string("/+VERSION");
|
||||||
#if defined(ANDROID) || defined(__ANDROID__)
|
std::ifstream in{path};
|
||||||
auto path = get_tz_dir() + string("/tzdata");
|
std::string version;
|
||||||
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;
|
|
||||||
if (in)
|
if (in)
|
||||||
{
|
{
|
||||||
in >> version;
|
in >> version;
|
||||||
@ -2925,11 +2919,9 @@ get_version()
|
|||||||
in >> version;
|
in >> version;
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
#endif // defined(ANDROID) || defined(__ANDROID__)
|
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(ANDROID) && !defined(__ANDROID__)
|
|
||||||
static
|
static
|
||||||
std::vector<leap_second>
|
std::vector<leap_second>
|
||||||
find_read_and_leap_seconds()
|
find_read_and_leap_seconds()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user