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

Cygwin Compatibility #388

Closed
ixokai opened this issue Sep 26, 2016 · 11 comments
Closed

Cygwin Compatibility #388

ixokai opened this issue Sep 26, 2016 · 11 comments

Comments

@ixokai
Copy link

ixokai commented Sep 26, 2016

Hi. I ran into two compatibility issues with using fmt in a cygwin (gcc 5.4.0 64-bit) environment.

  1. Apparently, when using c++11, gcc goes into strict mode and doesn't include any functions that aren't part of the standard. In particular, fdopen was an issue. Some googling told me you can include POSIX functions by #defining the following in posixc.c before any headers are imported:

define _POSIX_C_SOURCE 200809L

I'm not quite sure if this is actually cygwin specific or not, as this seems to be gcc -- but I'm not in a position to test on linux yet.

  1. Cygwin doesn't provide strtod_l, so I disabled FMT_LOCALE and then fmt compiled and worked.
@vitaut
Copy link
Contributor

vitaut commented Sep 27, 2016

I think you can workaround the first issue by adding a check for cygwin here:

#ifdef __MINGW32__
// Workaround MinGW bug https://sourceforge.net/p/mingw/bugs/2024/.
# undef __STRICT_ANSI__
#endif

in https://github.com/fmtlib/fmt/blob/master/fmt/posix.h#L13.

Could you submit the PR for this and the locale fix?

vitaut added a commit that referenced this issue Oct 2, 2016
@vitaut
Copy link
Contributor

vitaut commented Oct 2, 2016

Should be fixed in #388, but I don't have a Windows machine to test. @ixokai, does it work for you?

@vitaut
Copy link
Contributor

vitaut commented Oct 4, 2016

Closing for now but feel free to reopen if you still get errors.

@vitaut vitaut closed this as completed Oct 4, 2016
@speth
Copy link

speth commented Oct 22, 2016

I can confirm that this works, using G++ 5.4.0 on Cygwin. Any chance of getting a 3.0.x bugfix release or branch with this at some point (esp. since master contains backwards-incompatible changes like moving things to printf.h).

@vitaut
Copy link
Contributor

vitaut commented Oct 22, 2016

I plan to make a new release but only after completing the first draft of the standard proposal. Hopefully it won't take long but I don't have any specific dates as I work on this in my spare time (which was a bit limited lately because of switching to a new job). If you or anyone else (with reasonable github history =)) are willing to spend some time on preparing a new release, I'll be happy to give write permissions to the repo.

@vitaut
Copy link
Contributor

vitaut commented Oct 22, 2016

Hey, @foonathan. There were a few requests for a new minor release of fmt, so if you are still interested in helping out, I can give you write permissions. Thanks!

@vitaut
Copy link
Contributor

vitaut commented Oct 22, 2016

Basically it will require creating a new branch from version 3.0, picking and merging bug fixes that don't break API from 3.0.0...master and listing them in https://github.com/fmtlib/fmt/blob/master/ChangeLog.rst under the new entry (3.0.1). Then the support/manage.py script can be used to publish the release. Not the most exciting work ever =), but very important as the current release is missing some critical fixes right now.

@foonathan
Copy link
Contributor

Alright I can do that. What about other issues?

@vitaut
Copy link
Contributor

vitaut commented Oct 22, 2016

Thanks! I've added you to the list of collaborators with write permissions so you should receive a confirmation shortly.

Right now release is the most important thing, but if you are feeling adventurous =) feel free to pick up any issue from https://github.com/fmtlib/fmt/issues. Any contribution is welcome!

@foonathan
Copy link
Contributor

Okay, I'll see what I can do tomorrow.

foonathan pushed a commit that referenced this issue Oct 23, 2016
(cherry picked from commit cee50b7)
foonathan pushed a commit that referenced this issue Oct 23, 2016
(cherry picked from commit cee50b7)
vitaut added a commit that referenced this issue Jan 20, 2018
@amitdo
Copy link

amitdo commented Oct 28, 2018

Cygwin doesn't provide strtod_l, so I disabled FMT_LOCALE and then fmt compiled and worked.

https://github.com/cygwin/cygwin/blob/master/winsup/cygwin/release/2.6.0

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

No branches or pull requests

5 participants