Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT: Overhaul and refactor NPY_OS_WIN* #23806

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

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions numpy/core/include/numpy/npy_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
#endif

/* 64 bit file position support, also on win-amd64. Issue gh-2256 */
#if defined(_MSC_VER) && defined(_WIN64) && (_MSC_VER > 1400) || \
defined(__MINGW32__) || defined(__MINGW64__)
#if (defined(_MSC_VER) && (_MSC_VER > 1400) && defined(NPY_OS_WIN_64BIT)) || \
defined(__MINGW32__)
#include <io.h>

#define npy_fseek _fseeki64
Expand Down
12 changes: 7 additions & 5 deletions numpy/core/include/numpy/npy_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
#elif defined(__CYGWIN__)
#define NPY_OS_CYGWIN
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
#define NPY_OS_WIN32
#elif defined(_WIN64) || defined(__WIN64__) || defined(WIN64)
#define NPY_OS_WIN64
#elif defined(__MINGW32__) || defined(__MINGW64__)
#define NPY_OS_MINGW
/* _WIN32 is defined on 64-bit as well as 32-bit */
#define NPY_OS_WINDOWS
#if defined(_WIN64) || defined(__WIN64__) || defined(WIN64)
#define NPY_OS_WIN_64BIT
#else
#define NPY_OS_WIN_32BIT
#endif
#elif defined(__APPLE__)
#define NPY_OS_DARWIN
#elif defined(__HAIKU__)
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format)
size = PyArray_SIZE(self);
NPY_BEGIN_ALLOW_THREADS;

#if defined(NPY_OS_WIN64)
#if defined(NPY_OS_WIN_64BIT)
/*
* Workaround Win64 fwrite() bug. Issue gh-2256
* The native 64 windows runtime has this issue, the above will
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/umath/loops_trigonometric.dispatch.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ simd_range_reduction_@sfx@(npyv_@sfx@ x, npyv_@sfx@ y, npyv_@sfx@ c1, npyv_@sfx@
/**begin repeat
* #op = cos, sin#
*/
#if defined(NPY_OS_WIN32) || defined(NPY_OS_CYGWIN)
#if defined(NPY_OS_WINDOWS) || defined(NPY_OS_CYGWIN)
NPY_FINLINE npyv_f64
#else
NPY_NOINLINE npyv_f64
Expand Down
6 changes: 3 additions & 3 deletions numpy/f2py/cfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@
typedefs['unsigned_long'] = 'typedef unsigned long unsigned_long;'
typedefs['signed_char'] = 'typedef signed char signed_char;'
typedefs['long_long'] = """\
#if defined(NPY_OS_WIN32)
#if defined(NPY_OS_WINDOWS)
typedef __int64 long_long;
#else
typedef long long long_long;
typedef unsigned long long unsigned_long_long;
#endif
"""
typedefs['unsigned_long_long'] = """\
#if defined(NPY_OS_WIN32)
#if defined(NPY_OS_WINDOWS)
typedef __uint64 long_long;
#else
typedef unsigned long long unsigned_long_long;
Expand Down Expand Up @@ -542,7 +542,7 @@
#ifndef F2PY_THREAD_LOCAL_DECL
#if defined(_MSC_VER)
#define F2PY_THREAD_LOCAL_DECL __declspec(thread)
#elif defined(NPY_OS_MINGW)
#elif defined(__MINGW32__)
#define F2PY_THREAD_LOCAL_DECL __thread
#elif defined(__STDC_VERSION__) \\
&& (__STDC_VERSION__ >= 201112L) \\
Expand Down