Skip to content

xlocale.h is not available in newlib / Cygwin #8367

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

Merged
merged 1 commit into from
Dec 13, 2016

Conversation

embray
Copy link
Contributor

@embray embray commented Dec 12, 2016

All the symbols defined in xlocale.h are instead found in locale.h

@juliantaylor
Copy link
Contributor

locale.h is included a few lines earlier, better would be a header existance check for xlocale.h

see numpy/core/setup_common.py:OPTIONAL_HEADERS

@juliantaylor
Copy link
Contributor

juliantaylor commented Dec 12, 2016

I don't really see why xlocale is even included or how we are getting the posix 2008 newlocale declaration at all :/
though there was probably a reason so its better to leave it with an include guard

@embray
Copy link
Contributor Author

embray commented Dec 12, 2016

I considered the OPTIONAL_HEADERS approach but wasn't sure if it was overkill or not. I can do that. I don't know why it's used either but don't think it's worth investigating for the purposes of this fix.

#ifdef HAVE_XLOCALE_H
#include <xlocale.h>
#else
#include <locale.h>
Copy link
Contributor

@juliantaylor juliantaylor Dec 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locale.h is already included so this can be removed
please also add a comment, e.g. /* xlocale.h is included in locale.h on some systems */

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I didn't see that. Thanks for catching it.

@@ -1,7 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>

#include <locale.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I didn't mean to do this.

…from

xlocale.h are instead found in locale.h

Added a feature check for xlocale.h, with fallback to locale.h if it is
missing.
@juliantaylor
Copy link
Contributor

looks fine, thanks

@embray
Copy link
Contributor Author

embray commented Dec 13, 2016

Great, thanks!

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

Successfully merging this pull request may close these issues.

3 participants