summaryrefslogtreecommitdiff
path: root/numpy/random/setup.py
diff options
context:
space:
mode:
authorMichael Felt <aixtools@gmail.com>2016-10-18 20:06:51 +0000
committerMichael Felt <aixtools@gmail.com>2016-10-21 10:22:42 +0000
commit2c5e708f7a621bb714fc24c26e33f68afff45637 (patch)
treebed325533af3f874302d2c20700d0c9a7fc70d4f /numpy/random/setup.py
parent9bafab42c5d5b11023ef33622be425fc54584d6f (diff)
downloadnumpy-2c5e708f7a621bb714fc24c26e33f68afff45637.tar.gz
commit BLD: AIX uses the flag _LARGE_FILES to ensure proper prototype declarations
The problem this fix resolves is to ensure that 32-bit and 64-bit functions (e.g., fclear() and fclear64()) to access/manipulate "large files" are defined properly - much as GNU and other platforms use one or more of the defines _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and _LARGEFILE64_SOURCE. Without this fix the numpy code only defines flags that are not recognized in the AIX environment and have no effect in anyway. The fix applies the AIX convention and does not "export" any of the flags currently exported. For all other platforms the current flags: _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and _LARGEFILE64_SOURCE are "exported". This fix should not have any impact or side-effect based on the version of python used. History: Starting around 1997 AIX started supporting so-called "large files", i.e., length > signed 32-bit. In the period 1997-1998 the flag _LARGE_FILES was established to simplify porting 32-bit applications to 64-bit. The convention is to define _LARGE_FILES before including any "system include files" either as an argument to ${CC} (e.g., in ${CFLAGS} or as the first #define in every source file. This is to ensure that that no relevant function calls would be redefined later in the build process.
Diffstat (limited to 'numpy/random/setup.py')
-rw-r--r--numpy/random/setup.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/random/setup.py b/numpy/random/setup.py
index 9d905900c..88274bdef 100644
--- a/numpy/random/setup.py
+++ b/numpy/random/setup.py
@@ -31,7 +31,10 @@ def configuration(parent_package='',top_path=None):
# enable unix large file support on 32 bit systems
# (64 bit off_t, lseek -> lseek64 etc.)
- defs = [('_FILE_OFFSET_BITS', '64'),
+ if sys.platform[:3] == "aix":
+ defs = [('_LARGE_FILES', None)]
+ else:
+ defs = [('_FILE_OFFSET_BITS', '64'),
('_LARGEFILE_SOURCE', '1'),
('_LARGEFILE64_SOURCE', '1')]
if needs_mingw_ftime_workaround():