mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-09 14:47:59 +00:00
wscript: better _FILE_OFFSET_BITS check, as suggested by @nekonomicon
This commit is contained in:
parent
f63dd72260
commit
c69ea00e79
17
wscript
17
wscript
@ -301,12 +301,17 @@ def configure(conf):
|
|||||||
|
|
||||||
# set _FILE_OFFSET_BITS=64 for filesystems with 64-bit inodes
|
# set _FILE_OFFSET_BITS=64 for filesystems with 64-bit inodes
|
||||||
if conf.env.DEST_OS != 'win32' and conf.env.DEST_SIZEOF_VOID_P == 4:
|
if conf.env.DEST_OS != 'win32' and conf.env.DEST_SIZEOF_VOID_P == 4:
|
||||||
file_offset_bits_usable = conf.check_cc(fragment='''#define _FILE_OFFSET_BITS 64
|
# check was borrowed from libarchive source code
|
||||||
#include <features.h>
|
file_offset_bits_usable = conf.check_cc(fragment='''
|
||||||
#ifndef __USE_FILE_OFFSET64
|
#define _FILE_OFFSET_BITS 64
|
||||||
#error
|
#include <sys/types.h>
|
||||||
#endif
|
#define KB ((off_t)1024)
|
||||||
int main(void){ return 0; }''',
|
#define MB ((off_t)1024 * KB)
|
||||||
|
#define GB ((off_t)1024 * MB)
|
||||||
|
#define TB ((off_t)1024 * GB)
|
||||||
|
int t2[(((64 * GB -1) % 671088649) == 268434537)
|
||||||
|
&& (((TB - (64 * GB -1) + 255) % 1792151290) == 305159546)? 1: -1];
|
||||||
|
int main(void) { return 0; }''',
|
||||||
msg='Checking if _FILE_OFFSET_BITS can be defined to 64', mandatory=False)
|
msg='Checking if _FILE_OFFSET_BITS can be defined to 64', mandatory=False)
|
||||||
if file_offset_bits_usable:
|
if file_offset_bits_usable:
|
||||||
conf.define('_FILE_OFFSET_BITS', 64)
|
conf.define('_FILE_OFFSET_BITS', 64)
|
||||||
|
Loading…
Reference in New Issue
Block a user