1 #ifndef __stl_config__linux_h
2 #define __stl_config__linux_h
4 #define _STLP_PLATFORM "Linux"
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
17 #ifndef _STLP_USE_STDIO_IO
18 # define _STLP_USE_UNIX_IO
21 /* #define _STLP_USE_STDIO_IO */
23 /* If not explicitly specified otherwise, work with threads
25 #if !defined(_STLP_NO_THREADS) && !defined(_REENTRANT)
29 #if defined(_REENTRANT) && !defined(_PTHREADS)
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
39 # ifndef _STLP_NO_NATIVE_MBSTATE_T
40 # define _STLP_NO_NATIVE_MBSTATE_T
42 # ifndef _STLP_NO_NATIVE_WIDE_STREAMS
43 # define _STLP_NO_NATIVE_WIDE_STREAMS
45 # endif /* __UCLIBC_HAS_WCHAR__ */
46 /* Hmm, bogus _GLIBCPP_USE_NAMESPACES seems undefined... */
47 # define _STLP_VENDOR_GLOBAL_CSTD 1
51 #if defined(_PTHREADS)
52 # define _STLP_THREADS
53 # define _STLP_PTHREADS
59 /* This feature exist at least since glibc 2.2.4 */
60 /* # define __FIT_XSI_THR */ /* Unix 98 or X/Open System Interfaces Extention */
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
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
72 # ifndef _STLP_DONT_USE_PTHREAD_SPINLOCK
73 # define _STLP_USE_PTHREAD_SPINLOCK
74 # define _STLP_STATIC_MUTEX _STLP_mutex
76 /* # define __FIT_PSHARED_MUTEX */
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!"
86 #if ( __BYTE_ORDER == __LITTLE_ENDIAN )
87 # define _STLP_LITTLE_ENDIAN 1
88 #elif ( __BYTE_ORDER == __BIG_ENDIAN )
89 # define _STLP_BIG_ENDIAN 1
91 # error "__BYTE_ORDER neither __BIG_ENDIAN nor __LITTLE_ENDIAN; Fix me!"
94 #if defined(__GNUC__) && (__GNUC__ < 3)
95 # define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
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
105 /* Following platforms has no long double:
108 * - SPARC, 32-bits (64-bits platform has long double)
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__) || \
119 /* # if defined(__NO_LONG_DOUBLE_MATH) */
120 # define _STLP_NO_LONG_DOUBLE
125 #endif /* __stl_config__linux_h */