mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:31:41 +03:00
build: tidy up local lseek() mappings
- stop redefining system symbol `lseek`, by introducing `curl_lseek()`. - handle AmigaOS quirk within the macro mapping. - add missing parenthesis to `LSEEK_ERROR` values. - tool_util: use curl `lseek` macros in `tool_ftruncate64()`. - move `LSEEK_ERROR` to right-hand side of if expressions. - checksrc: disallow direct uses of `_lseeki64`, `llseek`, `lseek`. Closes #20488
This commit is contained in:
parent
47734f3244
commit
96fa42c7c0
7 changed files with 24 additions and 27 deletions
|
|
@ -490,28 +490,28 @@
|
|||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
/* Large file (>2Gb) support using Win32 functions. */
|
||||
# undef lseek
|
||||
# define lseek(fdes, offset, whence) _lseeki64(fdes, offset, whence)
|
||||
# undef fstat
|
||||
# define fstat(fdes, stp) _fstati64(fdes, stp)
|
||||
# define struct_stat struct _stati64
|
||||
# define LSEEK_ERROR (__int64)-1
|
||||
# define fstat(fdes, stp) _fstati64(fdes, stp)
|
||||
# define struct_stat struct _stati64
|
||||
# define curl_lseek _lseeki64
|
||||
# define LSEEK_ERROR ((__int64)-1)
|
||||
#elif defined(__DJGPP__)
|
||||
/* Requires DJGPP 2.04 */
|
||||
# include <unistd.h>
|
||||
# undef lseek
|
||||
# define lseek(fdes, offset, whence) llseek(fdes, offset, whence)
|
||||
# define LSEEK_ERROR (offset_t)-1
|
||||
# define curl_lseek llseek
|
||||
# define LSEEK_ERROR ((offset_t)-1)
|
||||
#elif defined(__AMIGA__)
|
||||
# define curl_lseek(fd, offset, whence) lseek(fd, (off_t)(offset), whence)
|
||||
# define LSEEK_ERROR ((off_t)-1)
|
||||
#else
|
||||
# define curl_lseek lseek
|
||||
# define LSEEK_ERROR ((off_t)-1)
|
||||
#endif
|
||||
|
||||
#ifndef struct_stat
|
||||
#define struct_stat struct stat
|
||||
#endif
|
||||
|
||||
#ifndef LSEEK_ERROR
|
||||
#define LSEEK_ERROR (off_t)-1
|
||||
#endif
|
||||
|
||||
#ifndef SIZEOF_TIME_T
|
||||
/* assume default size of time_t to be 32 bits */
|
||||
#define SIZEOF_TIME_T 4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue