diff options
author | Jon Lund Steffensen <jonlst@gmail.com> | 2020-06-13 18:56:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-13 18:56:37 -0700 |
commit | 3013a1bb9c9c5c2bb3b4cd085002081a87c2a3ad (patch) | |
tree | 7a1da739cbff1b13e9921f53604c25518a39160c /src/redshift.c | |
parent | Merge pull request #710 from hubvu/suspend-feature (diff) | |
parent | Try to remove brew upgrade python (diff) | |
download | redshift-ng-3013a1bb9c9c5c2bb3b4cd085002081a87c2a3ad.tar.gz redshift-ng-3013a1bb9c9c5c2bb3b4cd085002081a87c2a3ad.tar.bz2 redshift-ng-3013a1bb9c9c5c2bb3b4cd085002081a87c2a3ad.tar.xz |
Merge pull request #761 from jonls/jonls/remove-travis-macos-workaround
Fix all CI builds
Diffstat (limited to '')
-rw-r--r-- | src/redshift.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/redshift.c b/src/redshift.c index e0221d5..d2ba577 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -28,6 +28,7 @@ #include <math.h> #include <locale.h> #include <errno.h> +#include <time.h> /* poll.h is not available on Windows but there is no Windows location provider using polling. On Windows, we just define some stubs to make things compile. @@ -210,7 +211,11 @@ get_seconds_since_midnight(double timestamp) { time_t t = (time_t)timestamp; struct tm tm; +#ifdef _WIN32 + localtime_s(&tm, &t); +#else localtime_r(&t, &tm); +#endif return tm.tm_sec + tm.tm_min * 60 + tm.tm_hour * 3600; } |