1 #ifndef __stl_config__linux_h
2 #define __stl_config__linux_h
3 
4 #define _STLP_PLATFORM "Linux"
5 
6 #include <features.h>
7 
8 /* This is defined wether library in use is glibc or not.
9    This may be treated as presence of GNU libc compatible
10    header files (these define is not really intended to check
11    for the presence of a particular library, but rather is used
12    to define an INTERFACE.) */
13 #ifndef _STLP_USE_GLIBC
14 #  define _STLP_USE_GLIBC 1
15 #endif
16 
17 #ifndef _STLP_USE_STDIO_IO
18 #  define _STLP_USE_UNIX_IO
19 #endif
20 
21 /* #define _STLP_USE_STDIO_IO */
22 
23 /* If not explicitly specified otherwise, work with threads
24  */
25 #if !defined(_STLP_NO_THREADS) && !defined(_REENTRANT)
26 #  define _REENTRANT
27 #endif
28 
29 #if defined(_REENTRANT) && !defined(_PTHREADS)
30 # define _PTHREADS
31 #endif
32 
33 #ifdef __UCLIBC__ /* uClibc 0.9.27 */
34 #  define _STLP_USE_UCLIBC 1
35 #  if !defined(__UCLIBC_HAS_WCHAR__)
36 #    ifndef _STLP_NO_WCHAR_T
37 #      define _STLP_NO_WCHAR_T
38 #    endif
39 #    ifndef _STLP_NO_NATIVE_MBSTATE_T
40 #      define _STLP_NO_NATIVE_MBSTATE_T
41 #    endif
42 #    ifndef _STLP_NO_NATIVE_WIDE_STREAMS
43 #      define _STLP_NO_NATIVE_WIDE_STREAMS
44 #    endif
45 #  endif /* __UCLIBC_HAS_WCHAR__ */
46    /* Hmm, bogus _GLIBCPP_USE_NAMESPACES seems undefined... */
47 #  define _STLP_VENDOR_GLOBAL_CSTD 1
48 #endif
49 
50 
51 #if defined(_PTHREADS)
52 #  define _STLP_THREADS
53 #  define _STLP_PTHREADS
54 /*
55 #  ifndef __USE_UNIX98
56 #    define __USE_UNIX98
57 #  endif
58 */
59 /* This feature exist at least since glibc 2.2.4 */
60 /* #  define __FIT_XSI_THR */ /* Unix 98 or X/Open System Interfaces Extention */
61 #  ifdef __USE_XOPEN2K
62 /* The IEEE Std. 1003.1j-2000 introduces functions to implement spinlocks. */
63 #   ifndef __UCLIBC__ /* There are no spinlocks in uClibc 0.9.27 */
64 #     define _STLP_USE_PTHREAD_SPINLOCK
65 #   else
66 #     ifndef _STLP_DONT_USE_PTHREAD_SPINLOCK
67         /* in uClibc (0.9.26) pthread_spinlock* declared in headers
68          * but absent in library */
69 #       define _STLP_DONT_USE_PTHREAD_SPINLOCK
70 #     endif
71 #   endif
72 #   ifndef _STLP_DONT_USE_PTHREAD_SPINLOCK
73 #     define _STLP_USE_PTHREAD_SPINLOCK
74 #     define _STLP_STATIC_MUTEX _STLP_mutex
75 #   endif
76 /* #   define __FIT_PSHARED_MUTEX */
77 #  endif
78 #endif
79 
80 /* Endiannes */
81 #include <endian.h>
82 #if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN) || !defined(__BIG_ENDIAN)
83 #  error "One of __BYTE_ORDER, __LITTLE_ENDIAN and __BIG_ENDIAN undefined; Fix me!"
84 #endif
85 
86 #if ( __BYTE_ORDER == __LITTLE_ENDIAN )
87 #  define _STLP_LITTLE_ENDIAN 1
88 #elif ( __BYTE_ORDER == __BIG_ENDIAN )
89 #  define _STLP_BIG_ENDIAN 1
90 #else
91 #  error "__BYTE_ORDER neither __BIG_ENDIAN nor __LITTLE_ENDIAN; Fix me!"
92 #endif
93 
94 #if defined(__GNUC__) && (__GNUC__ < 3)
95 #  define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
96 #endif
97 
98 #ifdef __GLIBC__
99 #  if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || (__GLIBC__ > 2)
100 /* From glibc 2.3.x default allocator is malloc_alloc, if was not defined other */
101 #    if !defined(_STLP_USE_MALLOC) && !defined(_STLP_USE_NEWALLOC) && !defined(_STLP_USE_PERTHREAD_ALLOC) && !defined(_STLP_USE_NODE_ALLOC)
102 #      define _STLP_USE_MALLOC 1
103 #    endif
104 #  endif
105 /* Following platforms has no long double:
106  *   - Alpha
107  *   - PowerPC
108  *   - SPARC, 32-bits (64-bits platform has long double)
109  *   - MIPS, 32-bits
110  *   - ARM
111  *   - SH4
112  */
113 #  if defined(__alpha__) || \
114       defined(__ppc__) || defined(PPC) || defined(__powerpc__) || \
115       ((defined(__sparc) || defined(__sparcv9) || defined(__sparcv8plus)) && !defined ( __WORD64 ) && !defined(__arch64__)) /* ? */ || \
116       (defined(_MIPS_SIM) && (_MIPS_SIM == _ABIO32)) || \
117       defined(__arm__) || \
118       defined(__le32__) || \
119       defined(__sh__)
120  /* #  if defined(__NO_LONG_DOUBLE_MATH) */
121 #    define _STLP_NO_LONG_DOUBLE
122 #  endif
123 #endif
124 
125 
126 #endif /* __stl_config__linux_h */
127