Move timegm implementation to libshared (#3875)

Move `timegm` implementation to libshared
This commit is contained in:
Tobias Predel 2025-05-10 02:26:21 +02:00 committed by GitHub
parent 79eb38d582
commit 6c60a8db84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 0 additions and 26 deletions

View file

@ -67,7 +67,6 @@ SET (TASK_BINDIR bin CACHE STRING "Installation directory for the bi
# rust libs require these
set (TASK_LIBRARIES dl pthread)
check_function_exists (timegm HAVE_TIMEGM)
check_function_exists (get_current_dir_name HAVE_GET_CURRENT_DIR_NAME)
check_function_exists (wordexp HAVE_WORDEXP)

View file

@ -41,9 +41,6 @@
/* Found tm_gmtoff */
#cmakedefine HAVE_TM_GMTOFF
/* Found timegm */
#cmakedefine HAVE_TIMEGM
/* Found st.st_birthtime struct member */
#cmakedefine HAVE_ST_BIRTHTIME

View file

@ -218,24 +218,6 @@ const std::vector<std::string> extractParents(const std::string& project,
return vec;
}
////////////////////////////////////////////////////////////////////////////////
#ifndef HAVE_TIMEGM
time_t timegm(struct tm* tm) {
time_t ret;
char* tz;
tz = getenv("TZ");
setenv("TZ", "UTC", 1);
tzset();
ret = mktime(tm);
if (tz)
setenv("TZ", tz, 1);
else
unsetenv("TZ");
tzset();
return ret;
}
#endif
////////////////////////////////////////////////////////////////////////////////
bool nontrivial(const std::string& input) {
std::string::size_type i = 0;

View file

@ -54,10 +54,6 @@ const std::string indentProject(const std::string&, const std::string& whitespac
const std::vector<std::string> extractParents(const std::string&, const char& delimiter = '.');
#ifndef HAVE_TIMEGM
time_t timegm(struct tm* tm);
#endif
bool nontrivial(const std::string&);
const char* optionalBlankLine();
void setHeaderUnderline(Table&);