build2 / libbuild2-autoconf

Autoconf emulation build system module for build2
MIT License
6 stars 2 forks source link

Add SIZEOF_OFF_T.H #31

Closed EmilRosenquist closed 2 years ago

EmilRosenquist commented 2 years ago

Add SIZEOF_OFF_T.H

1

Posix

This is a data type defined in the sys/types.h header file (of fundamental type unsigned long) and is used to measure the file offset in bytes from the beginning of the file. It is defined as a signed, 32-bit integer, but if the programming environment enables large files off_t is defined to be a signed, 64-bit integer.

Always 4 on windows

boris-kolpackov commented 2 years ago

This line:

#elif __x86_64__ || __ppc64__ || _FILE_OFFSET_BITS == 64

I think is better re-written like this:

#elif defined(__x86_64__) || defined(__ppc64__) || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)

(It's true that undefined evaluates to false but some compilers warn about this implicit conversion).

Also, should we include some header to get the _FILE_OFFSET_BITS macro?

EmilRosenquist commented 2 years ago

@boris-kolpackov Updated to using defined(), Not sure what header we would include for the _FILE_OFFSET_BITS. From my understanding this is set by the user to support large files.https://digital-domain.net/largefiles.html