Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/julian_date.c needs "#include <time.h>" for gmtime_r #99

Closed
yurivict opened this issue Jan 4, 2018 · 2 comments
Closed

src/julian_date.c needs "#include <time.h>" for gmtime_r #99

yurivict opened this issue Jan 4, 2018 · 2 comments

Comments

@yurivict
Copy link

yurivict commented Jan 4, 2018

But on BSD it only works if included before #define _POSIX_C_SOURCE 1.

@yurivict yurivict changed the title src/julian_date.c needs #include <time.h> src/julian_date.c needs "#include <time.h>" for gmtime_r Jan 4, 2018
@ryeng ryeng self-assigned this Jan 27, 2018
@ryeng
Copy link
Contributor

ryeng commented Jan 27, 2018

You're right. I don't know why this has worked on Linux.

ryeng added a commit that referenced this issue Jan 27, 2018
Define _POSIX_C_SOURCE=1 at the top level to enable reentrant time
functions (especially gmtime_r) in time.h.

Closes #99.
@ryeng
Copy link
Contributor

ryeng commented Jan 27, 2018

I've made a pull request, but I don't have a FreeBSD box a the moment. It would be really helpful if you or someone else could test this on FreeBSD and report back.

ryeng added a commit that referenced this issue Jan 27, 2018
Define _XOPEN_SOURCE=700 at the top level to enable reentrant time
functions (especially gmtime_r) in time.h and M_PI in math.h.

This enables all X/Open 7 (incl. POSIX.1-2008) functionality.

Closes #99.
bjorgan pushed a commit that referenced this issue Jan 27, 2018
Define _XOPEN_SOURCE. Fix #99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants