mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Move timegm
implementation to libshared
(#3875)
Move `timegm` implementation to libshared
This commit is contained in:
parent
79eb38d582
commit
6c60a8db84
4 changed files with 0 additions and 26 deletions
|
@ -67,7 +67,6 @@ SET (TASK_BINDIR bin CACHE STRING "Installation directory for the bi
|
||||||
# rust libs require these
|
# rust libs require these
|
||||||
set (TASK_LIBRARIES dl pthread)
|
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 (get_current_dir_name HAVE_GET_CURRENT_DIR_NAME)
|
||||||
check_function_exists (wordexp HAVE_WORDEXP)
|
check_function_exists (wordexp HAVE_WORDEXP)
|
||||||
|
|
||||||
|
|
|
@ -41,9 +41,6 @@
|
||||||
/* Found tm_gmtoff */
|
/* Found tm_gmtoff */
|
||||||
#cmakedefine HAVE_TM_GMTOFF
|
#cmakedefine HAVE_TM_GMTOFF
|
||||||
|
|
||||||
/* Found timegm */
|
|
||||||
#cmakedefine HAVE_TIMEGM
|
|
||||||
|
|
||||||
/* Found st.st_birthtime struct member */
|
/* Found st.st_birthtime struct member */
|
||||||
#cmakedefine HAVE_ST_BIRTHTIME
|
#cmakedefine HAVE_ST_BIRTHTIME
|
||||||
|
|
||||||
|
|
18
src/util.cpp
18
src/util.cpp
|
@ -218,24 +218,6 @@ const std::vector<std::string> extractParents(const std::string& project,
|
||||||
return vec;
|
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) {
|
bool nontrivial(const std::string& input) {
|
||||||
std::string::size_type i = 0;
|
std::string::size_type i = 0;
|
||||||
|
|
|
@ -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 = '.');
|
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&);
|
bool nontrivial(const std::string&);
|
||||||
const char* optionalBlankLine();
|
const char* optionalBlankLine();
|
||||||
void setHeaderUnderline(Table&);
|
void setHeaderUnderline(Table&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue