Skip to content

Commit

Permalink
MAINT: remove outdated mingw32 fseek support
Browse files Browse the repository at this point in the history
`_fseeki64` and `_ftelli64` have been present in mingw-w64 for a long
time, see mingw-w64/mingw-w64@d66350e

This fixes an annoying build warning in the SciPy Meson build:
```
C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_common.h:185:20: warning: 'int _fseeki64(FILE*, long long int, int)' redeclared without dllimport attribute after being referenced with dll linkage
  185 | extern int __cdecl _fseeki64(FILE *, long long, int);
      |                    ^~~~~~~~~
C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_common.h:186:26: warning: 'long long int _ftelli64(FILE*)' redeclared without dllimport attribute after being referenced with dll linkage
  186 | extern long long __cdecl _ftelli64(FILE *);
      |                          ^~~~~~~~~
```

It's only happening for Pythran extensions, because Pythran uses `fseek`.
The cause is otherwise unrelated to Pythran though, it's `npy_common.h`
redefining something that's in mingw-w64.
  • Loading branch information
rgommers authored and charris committed Jan 27, 2022
1 parent 0100e09 commit 740c6ec
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions numpy/core/include/numpy/npy_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,6 @@
defined(__MINGW32__) || defined(__MINGW64__)
#include <io.h>

/* mingw based on 3.4.5 has lseek but not ftell/fseek */
#if defined(__MINGW32__) || defined(__MINGW64__)
extern int __cdecl _fseeki64(FILE *, long long, int);
extern long long __cdecl _ftelli64(FILE *);
#endif

#define npy_fseek _fseeki64
#define npy_ftell _ftelli64
#define npy_lseek _lseeki64
Expand Down

0 comments on commit 740c6ec

Please sign in to comment.