Skip to content

Commit 9682b46

Browse files
smemshlauft
authored andcommitted
Fix timegm() to use HAVE_TIMEGM from cmake so it uses libc version
There is a preprocessor define to use the system version of timegm() rather than a [slow] fallback function implemented in libshared. The function Datetime::timegm() conditionally manifests if said define is unset, but the code won't actually consult the value (provided by cmake), unless we include the cmake header. (This function is only used by Timewarrior, so Taskwarrior need not peg to a new libshared just for this fix.)
1 parent 6ffafdc commit 9682b46

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Datetime.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include <cstdint>
3333
#include <string>
3434

35+
#include "cmake.h"
36+
3537
#define EPOCH_MIN_VALUE 315532800 // 1980-01-01T00:00:00Z
3638
#define EPOCH_MAX_VALUE 253402293599 // 9999-12-31, 23:59:59 AoE
3739

0 commit comments

Comments
 (0)