Mon Jun 19 04:36:05 2023 UTC ()
merge xorgproto 2023.02


(mrg)
diff -r1.2 -r1.3 xsrc/external/mit/xorgproto/dist/include/X11/Xfuncproto.h

cvs diff -r1.2 -r1.3 xsrc/external/mit/xorgproto/dist/include/X11/Xfuncproto.h (switch to unified diff)

--- xsrc/external/mit/xorgproto/dist/include/X11/Xfuncproto.h 2021/05/09 16:13:39 1.2
+++ xsrc/external/mit/xorgproto/dist/include/X11/Xfuncproto.h 2023/06/19 04:36:05 1.3
@@ -1,229 +1,216 @@ @@ -1,229 +1,216 @@
1/* 1/*
2 * 2 *
3Copyright 1989, 1991, 1998 The Open Group 3Copyright 1989, 1991, 1998 The Open Group
4 4
5Permission to use, copy, modify, distribute, and sell this software and its 5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that 6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that 7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting 8copyright notice and this permission notice appear in supporting
9documentation. 9documentation.
10 10
11The above copyright notice and this permission notice shall be included in 11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software. 12all copies or substantial portions of the Software.
13 13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 20
21Except as contained in this notice, the name of The Open Group shall not be 21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings 22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group. 23in this Software without prior written authorization from The Open Group.
24 * 24 *
25 */ 25 */
26 26
27/* Definitions to make function prototypes manageable */ 27/* Definitions to make function prototypes manageable */
28 28
29#ifndef _XFUNCPROTO_H_ 29#ifndef _XFUNCPROTO_H_
30#define _XFUNCPROTO_H_ 30#define _XFUNCPROTO_H_
31 31
32#ifndef NeedFunctionPrototypes 32#ifndef NeedFunctionPrototypes
33#define NeedFunctionPrototypes 1 33#define NeedFunctionPrototypes 1
34#endif /* NeedFunctionPrototypes */ 34#endif /* NeedFunctionPrototypes */
35 35
36#ifndef NeedVarargsPrototypes 36#ifndef NeedVarargsPrototypes
37#define NeedVarargsPrototypes 1 37#define NeedVarargsPrototypes 1
38#endif /* NeedVarargsPrototypes */ 38#endif /* NeedVarargsPrototypes */
39 39
40#if NeedFunctionPrototypes 40#if NeedFunctionPrototypes
41 41
42#ifndef NeedNestedPrototypes 42#ifndef NeedNestedPrototypes
43#define NeedNestedPrototypes 1 43#define NeedNestedPrototypes 1
44#endif /* NeedNestedPrototypes */ 44#endif /* NeedNestedPrototypes */
45 45
46#ifndef _Xconst 46#ifndef _Xconst
47#define _Xconst const 47#define _Xconst const
48#endif /* _Xconst */ 48#endif /* _Xconst */
49 49
50/* Function prototype configuration (see configure for more info) */ 50/* Function prototype configuration (see configure for more info) */
51#if !defined(NARROWPROTO) && \ 51#if !defined(NARROWPROTO) && \
52 (defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) 52 (defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__))
53#define NARROWPROTO 53#define NARROWPROTO
54#endif 54#endif
55#ifndef FUNCPROTO 55#ifndef FUNCPROTO
56#define FUNCPROTO 15 56#define FUNCPROTO 15
57#endif 57#endif
58 58
59#ifndef NeedWidePrototypes 59#ifndef NeedWidePrototypes
60#ifdef NARROWPROTO 60#ifdef NARROWPROTO
61#define NeedWidePrototypes 0 61#define NeedWidePrototypes 0
62#else 62#else
63#define NeedWidePrototypes 1 /* default to make interropt. easier */ 63#define NeedWidePrototypes 1 /* default to make interropt. easier */
64#endif 64#endif
65#endif /* NeedWidePrototypes */ 65#endif /* NeedWidePrototypes */
66 66
67#endif /* NeedFunctionPrototypes */ 67#endif /* NeedFunctionPrototypes */
68 68
69#ifndef _XFUNCPROTOBEGIN 69#ifndef _XFUNCPROTOBEGIN
70#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */ 70#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
71#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */ 71#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
72#define _XFUNCPROTOEND } 72#define _XFUNCPROTOEND }
73#else 73#else
74#define _XFUNCPROTOBEGIN 74#define _XFUNCPROTOBEGIN
75#define _XFUNCPROTOEND 75#define _XFUNCPROTOEND
76#endif 76#endif
77#endif /* _XFUNCPROTOBEGIN */ 77#endif /* _XFUNCPROTOBEGIN */
78 78
79/* http://clang.llvm.org/docs/LanguageExtensions.html#has-attribute */ 79/* http://clang.llvm.org/docs/LanguageExtensions.html#has-attribute */
80#ifndef __has_attribute 80#ifndef __has_attribute
81# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ 81# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
82#endif 82#endif
83#ifndef __has_feature 83#ifndef __has_feature
84# define __has_feature(x) 0 /* Compatibility with non-clang compilers. */ 84# define __has_feature(x) 0 /* Compatibility with non-clang compilers. */
85#endif 85#endif
86#ifndef __has_extension 86#ifndef __has_extension
87# define __has_extension(x) 0 /* Compatibility with non-clang compilers. */ 87# define __has_extension(x) 0 /* Compatibility with non-clang compilers. */
88#endif 88#endif
89 89
90/* Added in X11R6.9, so available in any version of modular xproto */ 90/* Added in X11R6.9, so available in any version of modular xproto */
91#if __has_attribute(__sentinel__) || (defined(__GNUC__) && (__GNUC__ >= 4)) 91#if __has_attribute(__sentinel__) || (defined(__GNUC__) && (__GNUC__ >= 4))
92# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x))) 92# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
93#else 93#else
94# define _X_SENTINEL(x) 94# define _X_SENTINEL(x)
95#endif /* GNUC >= 4 */ 95#endif /* GNUC >= 4 */
96 96
97/* Added in X11R6.9, so available in any version of modular xproto */ 97/* Added in X11R6.9, so available in any version of modular xproto */
98#if (__has_attribute(visibility) || (defined(__GNUC__) && (__GNUC__ >= 4))) \ 98#if (__has_attribute(visibility) || (defined(__GNUC__) && (__GNUC__ >= 4))) \
99 && !defined(__CYGWIN__) && !defined(__MINGW32__) 99 && !defined(__CYGWIN__) && !defined(__MINGW32__)
100# define _X_EXPORT __attribute__((visibility("default"))) 100# define _X_EXPORT __attribute__((visibility("default")))
101# define _X_HIDDEN __attribute__((visibility("hidden"))) 101# define _X_HIDDEN __attribute__((visibility("hidden")))
102# define _X_INTERNAL __attribute__((visibility("internal"))) 102# define _X_INTERNAL __attribute__((visibility("internal")))
103#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) 103#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
104# define _X_EXPORT __global 104# define _X_EXPORT __global
105# define _X_HIDDEN __hidden 105# define _X_HIDDEN __hidden
106# define _X_INTERNAL __hidden 106# define _X_INTERNAL __hidden
107#else /* not gcc >= 4 and not Sun Studio >= 8 */ 107#else /* not gcc >= 4 and not Sun Studio >= 8 */
108# define _X_EXPORT 108# define _X_EXPORT
109# define _X_HIDDEN 109# define _X_HIDDEN
110# define _X_INTERNAL 110# define _X_INTERNAL
111#endif /* GNUC >= 4 */ 111#endif /* GNUC >= 4 */
112 112
113/* Branch prediction hints for individual conditionals */ 113/* Branch prediction hints for individual conditionals */
114/* requires xproto >= 7.0.9 */ 114/* requires xproto >= 7.0.9 */
115#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303) 115#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
116# define _X_LIKELY(x) __builtin_expect(!!(x), 1) 116# define _X_LIKELY(x) __builtin_expect(!!(x), 1)
117# define _X_UNLIKELY(x) __builtin_expect(!!(x), 0) 117# define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
118#else /* not gcc >= 3.3 */ 118#else /* not gcc >= 3.3 */
119# define _X_LIKELY(x) (x) 119# define _X_LIKELY(x) (x)
120# define _X_UNLIKELY(x) (x) 120# define _X_UNLIKELY(x) (x)
121#endif 121#endif
122 122
123/* Bulk branch prediction hints via marking error path functions as "cold" */ 123/* Bulk branch prediction hints via marking error path functions as "cold" */
124/* requires xproto >= 7.0.25 */ 124/* requires xproto >= 7.0.25 */
125#if __has_attribute(__cold__) || \ 125#if __has_attribute(__cold__) || \
126 (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403)) /* 4.3+ */ 126 (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403)) /* 4.3+ */
127# define _X_COLD __attribute__((__cold__)) 127# define _X_COLD __attribute__((__cold__))
128#else 128#else
129# define _X_COLD /* nothing */ 129# define _X_COLD /* nothing */
130#endif 130#endif
131 131
132/* Added in X11R6.9, so available in any version of modular xproto */ 132/* Added in X11R6.9, so available in any version of modular xproto */
133#if __has_attribute(deprecated) \ 133#if __has_attribute(deprecated) \
134 || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)) \ 134 || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)) \
135 || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5130)) 135 || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5130))
136# define _X_DEPRECATED __attribute__((deprecated)) 136# define _X_DEPRECATED __attribute__((deprecated))
137#else /* not gcc >= 3.1 */ 137#else /* not gcc >= 3.1 */
138# define _X_DEPRECATED 138# define _X_DEPRECATED
139#endif 139#endif
140 140
141/* requires xproto >= 7.0.30 */ 141/* requires xproto >= 7.0.30 */
142#if __has_extension(attribute_deprecated_with_message) || \ 142#if __has_extension(attribute_deprecated_with_message) || \
143 (defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))) 143 (defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))))
144# define _X_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg))) 144# define _X_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg)))
145#else 145#else
146# define _X_DEPRECATED_MSG(_msg) _X_DEPRECATED 146# define _X_DEPRECATED_MSG(_msg) _X_DEPRECATED
147#endif 147#endif
148 148
149/* requires xproto >= 7.0.17 */ 149/* requires xproto >= 7.0.17 */
150#if __has_attribute(noreturn) \ 150#if __has_attribute(noreturn) \
151 || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \ 151 || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
152 || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) 152 || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
153# define _X_NORETURN __attribute__((__noreturn__)) 153# define _X_NORETURN __attribute__((__noreturn__))
154#else 154#else
155# define _X_NORETURN 155# define _X_NORETURN
156#endif /* GNUC */ 156#endif /* GNUC */
157 157
158/* Added in X11R6.9, so available in any version of modular xproto */ 158/* Added in X11R6.9, so available in any version of modular xproto */
159#if __has_attribute(__format__) \ 159#if __has_attribute(__format__) \
160 || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203) 160 || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)
161# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y))) 161# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
162#else /* not gcc >= 2.3 */ 162#else /* not gcc >= 2.3 */
163# define _X_ATTRIBUTE_PRINTF(x,y) 163# define _X_ATTRIBUTE_PRINTF(x,y)
164#endif 164#endif
165 165
166/* requires xproto >= 7.0.22 - since this uses either gcc or C99 variable 
167 argument macros, must be only used inside #ifdef _X_NONNULL guards, as 
168 many legacy X clients are compiled in C89 mode still. */ 
169#if __has_attribute(nonnull) \ 
170 && defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ 
171#define _X_NONNULL(...) __attribute__((nonnull(__VA_ARGS__))) 
172#elif __has_attribute(nonnull) \ 
173 || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303) 
174#define _X_NONNULL(args...) __attribute__((nonnull(args))) 
175#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ 
176#define _X_NONNULL(...) /* */ 
177#endif 
178 
179/* requires xproto >= 7.0.22 */ 166/* requires xproto >= 7.0.22 */
180#if __has_attribute(__unused__) \ 167#if __has_attribute(__unused__) \
181 || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205) 168 || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
182#define _X_UNUSED __attribute__((__unused__)) 169#define _X_UNUSED __attribute__((__unused__))
183#else 170#else
184#define _X_UNUSED /* */ 171#define _X_UNUSED /* */
185#endif 172#endif
186 173
187/* C99 keyword "inline" or equivalent extensions in pre-C99 compilers */ 174/* C99 keyword "inline" or equivalent extensions in pre-C99 compilers */
188/* requires xproto >= 7.0.9 175/* requires xproto >= 7.0.9
189 (introduced in 7.0.8 but didn't support all compilers until 7.0.9) */ 176 (introduced in 7.0.8 but didn't support all compilers until 7.0.9) */
190#if defined(inline) /* assume autoconf set it correctly */ || \ 177#if defined(inline) /* assume autoconf set it correctly */ || \
191 (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ || \ 178 (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ || \
192 (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)) 179 (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550))
193# define _X_INLINE inline 180# define _X_INLINE inline
194#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ 181#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
195# define _X_INLINE __inline__ 182# define _X_INLINE __inline__
196#else 183#else
197# define _X_INLINE 184# define _X_INLINE
198#endif 185#endif
199 186
200/* C99 keyword "restrict" or equivalent extensions in pre-C99 compilers */ 187/* C99 keyword "restrict" or equivalent extensions in pre-C99 compilers */
201/* requires xproto >= 7.0.21 */ 188/* requires xproto >= 7.0.21 */
202#ifndef _X_RESTRICT_KYWD 189#ifndef _X_RESTRICT_KYWD
203# if defined(restrict) /* assume autoconf set it correctly */ || \ 190# if defined(restrict) /* assume autoconf set it correctly */ || \
204 (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ \ 191 (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ \
205 && !defined(__cplusplus)) /* Workaround g++ issue on Solaris */ 192 && !defined(__cplusplus)) /* Workaround g++ issue on Solaris */
206# define _X_RESTRICT_KYWD restrict 193# define _X_RESTRICT_KYWD restrict
207# elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ 194# elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
208# define _X_RESTRICT_KYWD __restrict__ 195# define _X_RESTRICT_KYWD __restrict__
209# else 196# else
210# define _X_RESTRICT_KYWD 197# define _X_RESTRICT_KYWD
211# endif 198# endif
212#endif 199#endif
213 200
214/* requires xproto >= 7.0.30 */ 201/* requires xproto >= 7.0.30 */
215#if __has_attribute(no_sanitize_thread) 202#if __has_attribute(no_sanitize_thread)
216# define _X_NOTSAN __attribute__((no_sanitize_thread)) 203# define _X_NOTSAN __attribute__((no_sanitize_thread))
217#else 204#else
218# define _X_NOTSAN 205# define _X_NOTSAN
219#endif 206#endif
220 207
221/* Mark a char array/pointer as not containing a NUL-terminated string */ 208/* Mark a char array/pointer as not containing a NUL-terminated string */
222/* requires xproto >= 7.0.33 */ 209/* requires xproto >= 7.0.33 */
223#if __has_attribute(nonstring) 210#if __has_attribute(nonstring)
224# define _X_NONSTRING __attribute__((nonstring)) 211# define _X_NONSTRING __attribute__((nonstring))
225#else 212#else
226# define _X_NONSTRING 213# define _X_NONSTRING
227#endif 214#endif
228 215
229#endif /* _XFUNCPROTO_H_ */ 216#endif /* _XFUNCPROTO_H_ */