1 | /* $Xorg: Xfuncproto.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
|
---|
2 | /*
|
---|
3 | *
|
---|
4 | Copyright 1989, 1991, 1998 The Open Group
|
---|
5 |
|
---|
6 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
7 | documentation for any purpose is hereby granted without fee, provided that
|
---|
8 | the above copyright notice appear in all copies and that both that
|
---|
9 | copyright notice and this permission notice appear in supporting
|
---|
10 | documentation.
|
---|
11 |
|
---|
12 | The above copyright notice and this permission notice shall be included in
|
---|
13 | all copies or substantial portions of the Software.
|
---|
14 |
|
---|
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
18 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
19 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
21 |
|
---|
22 | Except as contained in this notice, the name of The Open Group shall not be
|
---|
23 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
24 | in this Software without prior written authorization from The Open Group.
|
---|
25 | *
|
---|
26 | */
|
---|
27 | /* $XFree86: xc/include/Xfuncproto.h,v 3.4 2001/12/14 19:53:25 dawes Exp $ */
|
---|
28 |
|
---|
29 | /* Definitions to make function prototypes manageable */
|
---|
30 |
|
---|
31 | #ifndef _XFUNCPROTO_H_
|
---|
32 | #define _XFUNCPROTO_H_
|
---|
33 |
|
---|
34 | #ifndef NeedFunctionPrototypes
|
---|
35 | #define NeedFunctionPrototypes 1
|
---|
36 | #endif /* NeedFunctionPrototypes */
|
---|
37 |
|
---|
38 | #ifndef NeedVarargsPrototypes
|
---|
39 | #define NeedVarargsPrototypes 1
|
---|
40 | #endif /* NeedVarargsPrototypes */
|
---|
41 |
|
---|
42 | #if NeedFunctionPrototypes
|
---|
43 |
|
---|
44 | #ifndef NeedNestedPrototypes
|
---|
45 | #define NeedNestedPrototypes 1
|
---|
46 | #endif /* NeedNestedPrototypes */
|
---|
47 |
|
---|
48 | #ifndef _Xconst
|
---|
49 | #define _Xconst const
|
---|
50 | #endif /* _Xconst */
|
---|
51 |
|
---|
52 | /* Function prototype configuration (see configure for more info) */
|
---|
53 | #ifndef NARROWPROTO
|
---|
54 | #undef NARROWPROTO
|
---|
55 | #endif
|
---|
56 | #ifndef FUNCPROTO
|
---|
57 | #undef FUNCPROTO
|
---|
58 | #endif
|
---|
59 |
|
---|
60 | #ifndef NeedWidePrototypes
|
---|
61 | #ifdef NARROWPROTO
|
---|
62 | #define NeedWidePrototypes 0
|
---|
63 | #else
|
---|
64 | #define NeedWidePrototypes 1 /* default to make interropt. easier */
|
---|
65 | #endif
|
---|
66 | #endif /* NeedWidePrototypes */
|
---|
67 |
|
---|
68 | #endif /* NeedFunctionPrototypes */
|
---|
69 |
|
---|
70 | #ifndef _XFUNCPROTOBEGIN
|
---|
71 | #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
|
---|
72 | #define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
|
---|
73 | #define _XFUNCPROTOEND }
|
---|
74 | #else
|
---|
75 | #define _XFUNCPROTOBEGIN
|
---|
76 | #define _XFUNCPROTOEND
|
---|
77 | #endif
|
---|
78 | #endif /* _XFUNCPROTOBEGIN */
|
---|
79 |
|
---|
80 | #if defined(__GNUC__) && (__GNUC__ >= 4)
|
---|
81 | # define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
|
---|
82 | # define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
|
---|
83 | #else
|
---|
84 | # define _X_SENTINEL(x)
|
---|
85 | # define _X_ATTRIBUTE_PRINTF(x,y)
|
---|
86 | #endif /* GNUC >= 4 */
|
---|
87 |
|
---|
88 | #if defined(__GNUC__) && (__GNUC__ >= 4)
|
---|
89 | # define _X_EXPORT __attribute__((visibility("default")))
|
---|
90 | # define _X_HIDDEN __attribute__((visibility("hidden")))
|
---|
91 | # define _X_INTERNAL __attribute__((visibility("internal")))
|
---|
92 | #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
|
---|
93 | # define _X_EXPORT __global
|
---|
94 | # define _X_HIDDEN __hidden
|
---|
95 | # define _X_INTERNAL __hidden
|
---|
96 | #else /* not gcc >= 4 and not Sun Studio >= 8 */
|
---|
97 | # define _X_EXPORT
|
---|
98 | # define _X_HIDDEN
|
---|
99 | # define _X_INTERNAL
|
---|
100 | #endif /* GNUC >= 4 */
|
---|
101 |
|
---|
102 | #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
|
---|
103 | # define _X_LIKELY(x) __builtin_expect(!!(x), 1)
|
---|
104 | # define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
|
---|
105 | # define _X_INLINE inline
|
---|
106 | #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
|
---|
107 | # define _X_LIKELY(x) (x)
|
---|
108 | # define _X_UNLIKELY(x) (x)
|
---|
109 | # define _X_INLINE inline
|
---|
110 | #else /* not gcc >= 3.3 and not Sun Studio >= 8 */
|
---|
111 | # define _X_LIKELY(x) (x)
|
---|
112 | # define _X_UNLIKELY(x) (x)
|
---|
113 | # define _X_INLINE
|
---|
114 | #endif
|
---|
115 |
|
---|
116 | #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)
|
---|
117 | # define _X_DEPRECATED __attribute__((deprecated))
|
---|
118 | #else /* not gcc >= 3.1 */
|
---|
119 | # define _X_DEPRECATED
|
---|
120 | #endif
|
---|
121 |
|
---|
122 | #endif /* _XFUNCPROTO_H_ */
|
---|