]> Git Repo - uclibc-ng.git/blame - include/features.h
We already have tar.h, so might as well include cpio.h as well...
[uclibc-ng.git] / include / features.h
CommitLineData
64bc6412
EA
1#ifndef __FEATURES_H
2#define __FEATURES_H
3
38b20649 4
2c8e931c 5/* Major and minor version number of the uClibc library package. Use
38b20649
EA
6 these macros to test for features in specific releases. */
7#define __UCLIBC__ 0
8#define __UCLIBC_MAJOR__ 9
0ea968c3 9#define __UCLIBC_MINOR__ 5
38b20649 10
f91e94f6
EA
11/* There is an unwholesomely huge amount of code out there that depends on the
12 * presence of GNU libc header files. We have GNU libc header files. So here
13 * we commit a horrible sin. At this point, we _lie_ and claim to be GNU libc
14 * to make things like /usr/include/linux/socket.h and lots of apps work as
15 * their developers intended. This is IMHO, pardonable, since these defines
16 * are not really intended to check for the presence of a particular library,
17 * but rather are used to define an _interface_. */
62787816 18#if !defined _LIBC || defined __FORCE_GLIBC__
60ecd672
EA
19# define __GNU_LIBRARY__ 6
20# define __GLIBC__ 2
21# define __GLIBC_MINOR__ 1
22#endif
f91e94f6 23
eb2ecd0b
EA
24/* Make a half-hearted attempt to accomodate non-gcc compilers */
25#ifndef __GNUC__
26#define __attribute(foo) /* Ignore */
27#endif
28
6395e858
DS
29/* Convenience macro to test the version of gcc.
30 * Use it like this:
31 * #if __GNUC_PREREQ (2,8)
32 * ... code requiring gcc 2.8 or later ...
33 * #endif
34 * Note - they won't work for gcc1, since the _MINOR macros
35 * were not defined then. */
36#if defined __GNUC__ && defined __GNUC_MINOR__
37#define __GNUC_PREREQ(maj, min) \
38 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
39#else
40#define __GNUC_PREREQ(maj,min) 0
41#endif
42
69e291e4 43/* __restrict is known in EGCS 1.2 and above. */
c526f7d4 44#if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 92)
69e291e4
EA
45# define __restrict /* Ignore */
46#endif
47
92773db4
EA
48/* __extension__ is known in gcc 2.8 above. */
49#if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
50# define __extension__ /* Ignore */
51#endif
38b20649 52
64bc6412
EA
53#ifdef __STDC__
54
e547d07a
EA
55#define __P(x) x
56#define __PMT(x) x
ddaf9409 57#ifndef __const
64bc6412 58#define __const const
ddaf9409 59#endif
64bc6412
EA
60
61/* Almost ansi */
62#if __STDC__ != 1
ddaf9409 63#ifndef const
64bc6412 64#define const
ddaf9409 65#endif
64bc6412
EA
66#define volatile
67#endif
68
69#else /* K&R */
70
71#define __P(x) ()
ddaf9409 72#ifndef __const
64bc6412 73#define __const
ddaf9409
EA
74#endif
75#ifndef const
64bc6412 76#define const
ddaf9409 77#endif
64bc6412
EA
78#define volatile
79
80#endif
81
64bc6412
EA
82/* GNUish things */
83#define __CONSTVALUE
84#define __CONSTVALUE2
85
ffb96c09
EA
86#define __USE_BSD
87#define __USE_MISC
88#define __USE_POSIX
56e5d28c 89#define __USE_POSIX2
04bc82ed 90#define __USE_XOPEN
64bc6412 91
469cdfc5
EA
92#undef __KERNEL_STRICT_NAMES
93#ifndef _LOOSE_KERNEL_NAMES
94# define __KERNEL_STRICT_NAMES
95#endif
96
0ae38142
MNI
97#ifdef _GNU_SOURCE
98# define __USE_GNU 1
99#endif
eb2ecd0b 100
64bc6412
EA
101#include <sys/cdefs.h>
102
f7457980
MNI
103#define __need_uClibc_config_h
104#include <bits/uClibc_config.h>
105#undef __need_uClibc_config_h
64bc6412 106
70b504a5 107
92773db4
EA
108/* Some nice features only work properly with ELF */
109#if defined HAVE_ELF
110# define link_warning(symbol, msg) \
111 asm (".section " ".gnu.warning." #symbol "\n\t.previous"); \
112 static const char __evoke_link_warning_##symbol[] \
113 __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
635c2432
DM
114# define weak_alias(name, aliasname) \
115 asm(".global " #name ";.weak " #aliasname ";" #aliasname "=" #name ";");
70b504a5 116#else
92773db4
EA
117# define link_warning(symbol, msg) \
118 asm (".stabs \"" msg "\",30,0,0,0\n\t" \
119 ".stabs \"" #symbol "\",1,0,0,0\n");
120# define weak_alias(name, aliasname) \
121 __asm__(".global alias\n.set alias,original");
70b504a5
EA
122#endif
123
124
64bc6412
EA
125#endif
126
This page took 0.044363 seconds and 4 git commands to generate.