(__select): Don't fault when some fdmask is 0.
[glibc.git] / misc / sys / cdefs.h
blob8336aa4038198afc341d0b03ff6208ed1f68304e
1 /* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
19 #ifndef _SYS_CDEFS_H
21 #define _SYS_CDEFS_H 1
22 #include <features.h>
24 /* Some user header file might have defined this before. */
25 #undef __P
27 #ifdef __GNUC__
29 #define __P(args) args /* GCC can always grok prototypes. */
30 #define __DOTS , ...
32 #else /* Not GCC. */
34 #define __inline /* No inline functions. */
36 #if (defined (__STDC__) && __STDC__) || defined (__cplusplus)
38 #define __P(args) args
39 #define __const const
40 #define __signed signed
41 #define __volatile volatile
42 #define __DOTS , ...
44 #else /* Not ANSI C or C++. */
46 #define __P(args) () /* No prototypes. */
47 #define __const /* No ANSI C keywords. */
48 #define __signed
49 #define __volatile
50 #define __DOTS
52 #endif /* ANSI C or C++. */
54 #endif /* GCC. */
56 /* For these things, GCC behaves the ANSI way normally,
57 and the non-ANSI way under -traditional. */
59 #if defined (__STDC__) && __STDC__
61 #define __CONCAT(x,y) x ## y
62 #define __STRING(x) #x
64 /* This is not a typedef so `const __ptr_t' does the right thing. */
65 #define __ptr_t void *
66 typedef long double __long_double_t;
68 #else
70 #define __CONCAT(x,y) x/**/y
71 #define __STRING(x) "x"
73 #define __ptr_t char *
74 typedef double __long_double_t;
76 #endif
78 /* The BSD header files use the ANSI keywords unmodified. (This means that
79 old programs may lose if they use the new keywords as identifiers.) We
80 define them to their __ versions, which are taken care of above. */
82 #ifdef __USE_BSD
83 #define const __const
84 #define signed __signed
85 #define volatile __volatile
86 #endif
88 /* C++ needs to know that types and declarations are C, not C++. */
89 #ifdef __cplusplus
90 #define __BEGIN_DECLS extern "C" {
91 #define __END_DECLS }
92 #else
93 #define __BEGIN_DECLS
94 #define __END_DECLS
95 #endif
97 /* GCC2 has various useful declarations that can be made with the
98 `__attribute__' syntax. All of the ways we use this do fine if
99 they are omitted for compilers that don't understand it. */
100 #if !defined (__GNUC__) || __GNUC__ < 2
101 #define __attribute__(xyz) /* Ignore. */
102 #endif
104 #endif /* sys/cdefs.h */