mirror of
https://github.com/switchbrew/switch-tools.git
synced 2025-06-21 21:42:39 +02:00
sanitise large file support
This commit is contained in:
parent
d2a2a3db26
commit
48d96a7033
@ -12,6 +12,7 @@ AC_CANONICAL_HOST
|
|||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|
||||||
|
AC_SYS_LARGEFILE
|
||||||
|
|
||||||
PKG_CHECK_MODULES([LZ4],
|
PKG_CHECK_MODULES([LZ4],
|
||||||
[liblz4 >= 1.7.1 liblz4 < 100],
|
[liblz4 >= 1.7.1 liblz4 < 100],
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define __USE_LARGEFILE64
|
|
||||||
|
|
||||||
#define MAX_SWITCHPATH 0x300
|
#define MAX_SWITCHPATH 0x300
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -22,16 +20,9 @@ inline int fseeko64(FILE *__stream, long long __off, int __whence)
|
|||||||
{
|
{
|
||||||
return _fseeki64(__stream, __off, __whence);
|
return _fseeki64(__stream, __off, __whence);
|
||||||
}
|
}
|
||||||
#elif __APPLE__ || __CYGWIN__
|
|
||||||
// OS X file I/O is 64bit
|
|
||||||
#define fseeko64 fseek
|
|
||||||
#elif __linux__
|
|
||||||
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
|
|
||||||
#else
|
#else
|
||||||
/* fseeko is guaranteed by POSIX, hopefully the OS made their off_t definition 64-bit;
|
/* off_t is 64-bit with large file support */
|
||||||
* known sane on FreeBSD and OpenBSD.
|
#define fseeko64 fseek
|
||||||
*/
|
|
||||||
#define fseeko64 fseeko
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -53,12 +44,12 @@ typedef struct _stati64 os_stat64_t;
|
|||||||
typedef char oschar_t; /* utf-8 */
|
typedef char oschar_t; /* utf-8 */
|
||||||
typedef DIR osdir_t;
|
typedef DIR osdir_t;
|
||||||
typedef struct dirent osdirent_t;
|
typedef struct dirent osdirent_t;
|
||||||
typedef struct stat64 os_stat64_t;
|
typedef struct stat os_stat64_t;
|
||||||
|
|
||||||
#define os_fopen fopen
|
#define os_fopen fopen
|
||||||
#define os_opendir opendir
|
#define os_opendir opendir
|
||||||
#define os_readdir readdir
|
#define os_readdir readdir
|
||||||
#define os_stat stat64
|
#define os_stat stat
|
||||||
#define os_fclose fclose
|
#define os_fclose fclose
|
||||||
|
|
||||||
#define OS_MODE_READ "rb"
|
#define OS_MODE_READ "rb"
|
||||||
@ -85,4 +76,4 @@ void filepath_os_append(filepath_t *fpath, oschar_t *path);
|
|||||||
void filepath_append(filepath_t *fpath, const char *format, ...);
|
void filepath_append(filepath_t *fpath, const char *format, ...);
|
||||||
void filepath_append_n(filepath_t *fpath, uint32_t n, const char *format, ...);
|
void filepath_append_n(filepath_t *fpath, uint32_t n, const char *format, ...);
|
||||||
void filepath_set(filepath_t *fpath, const char *path);
|
void filepath_set(filepath_t *fpath, const char *path);
|
||||||
oschar_t *filepath_get(filepath_t *fpath);
|
oschar_t *filepath_get(filepath_t *fpath);
|
||||||
|
Loading…
Reference in New Issue
Block a user