Fix unused functions on Android

... spotted with `-Wall`

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
This commit is contained in:
Vasyl Gello 2024-09-30 00:04:47 +03:00 committed by Howard Hinnant
parent fca69e308d
commit 447f5a30b9

View File

@ -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()