diff options
-rw-r--r-- | .travis.yml | 8 | ||||
-rw-r--r-- | src/redshift.c | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index b165a69..cc0d35d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,14 +34,6 @@ before_install: | brew install gettext brew link --force gettext brew install intltool - brew upgrade python - - # distuninstallcheck fails on macOS when automake 1.16 or 1.16.1 is used. - # http://gnu-automake.7480.n7.nabble.com/bug-31222-automake-1-16-1-am-pep3147-tweak-bug-td22937.html - # No upstream release yet, use upstream patch. - pushd /usr/local/Cellar/automake/*/share/automake-* - curl "https://git.savannah.gnu.org/cgit/automake.git/patch/?id=a348d830659fffd2cfc42994524783b07e69b4b5" | tail -n 14 | sudo patch -p2 - popd fi install: 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; } |