8000 Handle NetBSD specific <sys/endian.h> by krytarowski · Pull Request #7885 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Handle NetBSD specific <sys/endian.h> #7885

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
Aug 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Handle NetBSD specific <sys/endian.h>
  • Loading branch information
krytarowski committed Jul 31, 2016
commit bcba4410c4b04bbcaad897302eea52fd5cf8479e
1 change: 1 addition & 0 deletions numpy/core/include/numpy/_numpyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#define NPY_API_VERSION @NPY_API_VERSION@

@DEFINE_NPY_HAVE_ENDIAN_H@
@DEFINE_NPY_HAVE_SYS_ENDIAN_H@

/* Ugly, but we can't test this in a proper manner without requiring a C++
* compiler at the configuration stage of numpy ? */
Expand Down
7 changes: 6 additions & 1 deletion numpy/core/include/numpy/npy_endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
* endian.h
*/

#ifdef NPY_HAVE_ENDIAN_H
#if defined(NPY_HAVE_ENDIAN_H) || defined(NPY_HAVE_SYS_ENDIAN_H)
/* Use endian.h if available */

#if defined(NPY_HAVE_ENDIAN_H)
#include <endian.h>
#elif defined(NPY_HAVE_SYS_ENDIAN_H)
#include <sys/endian.h>
#endif

#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && defined(LITTLE_ENDIAN)
#define NPY_BYTE_ORDER BYTE_ORDER
Expand Down
4 changes: 4 additions & 0 deletions numpy/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ def check_types(config_cmd, ext, build_dir):
if res:
private_defines.append(('HAVE_ENDIAN_H', 1))
public_defines.append(('NPY_HAVE_ENDIAN_H', 1))
res = config_cmd.check_header("sys/endian.h")
if res:
private_defines.append(('HAVE_SYS_ENDIAN_H', 1))
public_defines.append(('NPY_HAVE_SYS_ENDIAN_H', 1))

# Check basic types sizes
for type in ('short', 'int', 'long'):
Expand Down
0