Skip to content
This repository has been archived by the owner on Sep 10, 2023. It is now read-only.

Compile with mingw32 #3

Closed
dmtmalin opened this issue May 6, 2017 · 4 comments
Closed

Compile with mingw32 #3

dmtmalin opened this issue May 6, 2017 · 4 comments

Comments

@dmtmalin
Copy link

dmtmalin commented May 6, 2017

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; }

@staticlibs
Copy link
Owner

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.

@dmtmalin
Copy link
Author

dmtmalin commented May 7, 2017

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.

@dmtmalin
Copy link
Author

dmtmalin commented May 7, 2017

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

@staticlibs
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants