Skip to content

Commit 6c60a8d

Browse files
authored
Move timegm implementation to libshared (#3875)
Move `timegm` implementation to libshared
1 parent 79eb38d commit 6c60a8d

File tree

4 files changed

+0
-26
lines changed

4 files changed

+0
-26
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ SET (TASK_BINDIR bin CACHE STRING "Installation directory for the bi
6767
# rust libs require these
6868
set (TASK_LIBRARIES dl pthread)
6969

70-
check_function_exists (timegm HAVE_TIMEGM)
7170
check_function_exists (get_current_dir_name HAVE_GET_CURRENT_DIR_NAME)
7271
check_function_exists (wordexp HAVE_WORDEXP)
7372

cmake.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
/* Found tm_gmtoff */
4242
#cmakedefine HAVE_TM_GMTOFF
4343

44-
/* Found timegm */
45-
#cmakedefine HAVE_TIMEGM
46-
4744
/* Found st.st_birthtime struct member */
4845
#cmakedefine HAVE_ST_BIRTHTIME
4946

src/util.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -218,24 +218,6 @@ const std::vector<std::string> extractParents(const std::string& project,
218218
return vec;
219219
}
220220

221-
////////////////////////////////////////////////////////////////////////////////
222-
#ifndef HAVE_TIMEGM
223-
time_t timegm(struct tm* tm) {
224-
time_t ret;
225-
char* tz;
226-
tz = getenv("TZ");
227-
setenv("TZ", "UTC", 1);
228-
tzset();
229-
ret = mktime(tm);
230-
if (tz)
231-
setenv("TZ", tz, 1);
232-
else
233-
unsetenv("TZ");
234-
tzset();
235-
return ret;
236-
}
237-
#endif
238-
239221
////////////////////////////////////////////////////////////////////////////////
240222
bool nontrivial(const std::string& input) {
241223
std::string::size_type i = 0;

src/util.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ const std::string indentProject(const std::string&, const std::string& whitespac
5454

5555
const std::vector<std::string> extractParents(const std::string&, const char& delimiter = '.');
5656

57-
#ifndef HAVE_TIMEGM
58-
time_t timegm(struct tm* tm);
59-
#endif
60-
6157
bool nontrivial(const std::string&);
6258
const char* optionalBlankLine();
6359
void setHeaderUnderline(Table&);

0 commit comments

Comments
 (0)