ENH: Separate the notion of a request for LFS and its availability. Allow user code to block definitions of LFS macros. Added framework to give error if sys/types.h is included before this header when LFS is requested (currently disabled).

This commit is contained in:
Brad King 2006-08-25 16:07:06 -04:00
parent ffb1a9f80a
commit ebf532b106
1 changed files with 35 additions and 9 deletions

View File

@ -22,18 +22,44 @@
# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
#endif
/* This is a support for files on the disk that are larger than 2GB. Since
this is the first place that any include should happen, do this here. */
#if @KWSYS_LFS_AVAILABLE@
# ifndef _LARGEFILE_SOURCE
# define _LARGEFILE_SOURCE
/* Whether Large File Support is requested. */
#define @KWSYS_NAMESPACE@_LFS_REQUESTED @KWSYS_LFS_REQUESTED@
/* Whether Large File Support is available. */
#if @KWSYS_NAMESPACE@_LFS_REQUESTED
# define @KWSYS_NAMESPACE@_LFS_AVAILABLE @KWSYS_LFS_AVAILABLE@
#endif
/* Setup Large File Support if requested. */
#if @KWSYS_NAMESPACE@_LFS_REQUESTED
/* Since LFS is requested this header must be included before system
headers whether or not LFS is available. */
# if 0 && (defined(_SYS_TYPES_H) || defined(_SYS_TYPES_INCLUDED))
# error "@KWSYS_NAMESPACE@/Configure.h must be included before sys/types.h"
# endif
/* Enable the large file API if it is available. */
# if @KWSYS_NAMESPACE@_LFS_AVAILABLE && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINES)
# if !defined(_LARGEFILE_SOURCE) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGEFILE_SOURCE)
# define _LARGEFILE_SOURCE
# endif
# ifndef _LARGE_FILES
# define _LARGE_FILES
# if !defined(_LARGEFILE64_SOURCE) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGEFILE64_SOURCE)
# define _LARGEFILE64_SOURCE
# endif
# ifndef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 64
# if !defined(_LARGE_FILES) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGE_FILES)
# define _LARGE_FILES
# endif
# if !defined(_FILE_OFFSET_BITS) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_FILE_OFFSET_BITS)
# define _FILE_OFFSET_BITS 64
# endif
# if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS < 64
# error "_FILE_OFFSET_BITS must be defined to at least 64"
# endif
# endif
#endif
/* Setup the export macro. */