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

Skip to content

Commit a4d1e26

Browse files
committed
MAINT: add a configure check for ftello and fseeko
Works on Ubuntu/Debian, might require lfs macros on some platforms to succeed, but its also defined by Python.h so it should mostly work.
1 parent da3ad01 commit a4d1e26

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

numpy/core/include/numpy/npy_common.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,16 @@
7474
#error Unsupported size for type off_t
7575
#endif
7676
#else
77+
#ifdef HAVE_FSEEKO
7778
#define npy_fseek fseeko
79+
#else
80+
#define npy_fseek fseek
81+
#endif
82+
#ifdef HAVE_FTELLO
7883
#define npy_ftell ftello
84+
#else
85+
#define npy_ftell ftell
86+
#endif
7987
#define npy_lseek lseek
8088
#define npy_off_t off_t
8189

numpy/core/setup_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def check_api_version(apiversion, codegen_dir):
9898
# replacement implementation. Note that some of these are C99 functions.
9999
OPTIONAL_STDFUNCS = ["expm1", "log1p", "acosh", "asinh", "atanh",
100100
"rint", "trunc", "exp2", "log2", "hypot", "atan2", "pow",
101-
"copysign", "nextafter"]
101+
"copysign", "nextafter", "ftello", "fseeko"]
102102

103103

104104
OPTIONAL_HEADERS = [
@@ -129,7 +129,7 @@ def check_api_version(apiversion, codegen_dir):
129129

130130
# Subset of OPTIONAL_STDFUNCS which may alreay have HAVE_* defined by Python.h
131131
OPTIONAL_STDFUNCS_MAYBE = ["expm1", "log1p", "acosh", "atanh", "asinh", "hypot",
132-
"copysign"]
132+
"copysign", "ftello", "fseeko"]
133133

134134
# C99 functions: float and long double versions
135135
C99_FUNCS = ["sin", "cos", "tan", "sinh", "cosh", "tanh", "fabs", "floor",

0 commit comments

Comments
 (0)