ROSE  0.11.145.0
fileoffsetbits.h
1 #ifndef __fileoffsetbits
2 #define __fileoffsetbits
3 // DQ (3/12/2006): This is included here as specified in the Autoconf manual (using <> instead of "")
4 // We have also abandoned the ifdef HAVE_CONFIG_H cpp conditional use of rose_config.h as well.
5 // This is placed here in sage3.h instead of in rose.h because it needs to always be seen even
6 // by internal ROSE files that only include sage3.h.
7 
8 // DQ (10/14/2010): We don't want to include this into our header file system
9 // since then users will see the defined macros in our autoconf generated
10 // config.h (which we generate as rose_config.h to avoid filename conflicts).
11 // This fixes the problem that causes macro names to conflict (e.g. PACKAGE_BUGREPORT).
12 // #include <rose_config.h>
13 
14 // DQ (4/21/2009): Error checking to avoid difficult to debug ODR violations on 32-bit systems.
15 #if defined(_SYS_STAT_H)
16 #error "sys/stat.h should not have been included before the _FILE_OFFSET_BITS macro is set! (use rose.h first...)"
17 #endif
18 
19 // DQ (4/21/2009): This must be included before rose_paths.h since that
20 // header includes the STL string header which will include sys/stat.h first.
21 // Force 64-bit file offsets in struct stat
22 #if __sun
23  #ifndef _FILE_OFFSET_BITS
24  #ifdef __arch64__
25  #define _FILE_OFFSET_BITS 64
26  #else
27  #define _FILE_OFFSET_BITS 32
28  #endif /* __arch64__ */
29  #endif /* _FILE_OFFSET_BITS */
30 #else
31 #define _FILE_OFFSET_BITS 64
32 #endif /* __sun */
33 
34 // DQ (4/21/2009): This must be set before sys/stat.h is included by any other header file.
35 // Use of _FILE_OFFSET_BITS macro is required on 32-bit systems to controling size of "struct stat"
36 #if !defined(__sun)
37 #if !(defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64))
38 #error "The _FILE_OFFSET_BITS macro should be set before any sys/stat.h is included by any other header file!"
39 #endif
40 #endif /* __sun */
41 
42 #endif