staticlibs/ccronexpr

Compile with mingw32

dmtmalin opened this issue · 4 comments

Hi! If to use mingw32, then a error:
ccronexpr.cpp:83: error: undefined reference to `_mkgmtime'
Maybe can use this for UTC time?
#ifdef _WIN32 time_t cron_mktime(struct tm* tm) { return mktime(tm) - timezone; }

Hi, I wonder what version of mingw are you using? The following worked for me with mingw from here:

gcc ccronexpr.c ccronexpr_test.c -I. -Wall -Wextra -std=c89 && a.exe
gcc --version
> gcc (GCC) 6.3.0

I will happily accept a PR for mingw32, if you submit one, assuming that time.h logic for MSVC and Linux GCC will stay unchanged. time.h API is really hairy, afraid to change current variant that works there.

I'm used MinGW with Qt:

C:\Qt\Tools\mingw530_32\bin>gcc.exe --version
gcc.exe (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I'm try return mktime(tm) - timezone; tests is successful.

Mingw should work now with #4 merged, closing the issue.