Move timegm implementation to libshared

This commit is contained in:
Tobias Predel 2025-05-09 20:24:40 +02:00
parent 79eb38d582
commit 4e43c15d5a
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&);