Xfuncproto.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /* Xfuncproto.h. Generated from Xfuncproto.h.in by configure. */
  2. /*
  3. *
  4. Copyright 1989, 1991, 1998 The Open Group
  5. Permission to use, copy, modify, distribute, and sell this software and its
  6. documentation for any purpose is hereby granted without fee, provided that
  7. the above copyright notice appear in all copies and that both that
  8. copyright notice and this permission notice appear in supporting
  9. documentation.
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  16. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  17. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  18. Except as contained in this notice, the name of The Open Group shall not be
  19. used in advertising or otherwise to promote the sale, use or other dealings
  20. in this Software without prior written authorization from The Open Group.
  21. *
  22. */
  23. /* Definitions to make function prototypes manageable */
  24. #ifndef _XFUNCPROTO_H_
  25. #define _XFUNCPROTO_H_
  26. #ifndef NeedFunctionPrototypes
  27. #define NeedFunctionPrototypes 1
  28. #endif /* NeedFunctionPrototypes */
  29. #ifndef NeedVarargsPrototypes
  30. #define NeedVarargsPrototypes 1
  31. #endif /* NeedVarargsPrototypes */
  32. #if NeedFunctionPrototypes
  33. #ifndef NeedNestedPrototypes
  34. #define NeedNestedPrototypes 1
  35. #endif /* NeedNestedPrototypes */
  36. #ifndef _Xconst
  37. #define _Xconst const
  38. #endif /* _Xconst */
  39. /* Function prototype configuration (see configure for more info) */
  40. #ifndef NARROWPROTO
  41. #define NARROWPROTO /**/
  42. #endif
  43. #ifndef FUNCPROTO
  44. #define FUNCPROTO 15
  45. #endif
  46. #ifndef NeedWidePrototypes
  47. #ifdef NARROWPROTO
  48. #define NeedWidePrototypes 0
  49. #else
  50. #define NeedWidePrototypes 1 /* default to make interropt. easier */
  51. #endif
  52. #endif /* NeedWidePrototypes */
  53. #endif /* NeedFunctionPrototypes */
  54. #ifndef _XFUNCPROTOBEGIN
  55. #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
  56. #define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
  57. #define _XFUNCPROTOEND }
  58. #else
  59. #define _XFUNCPROTOBEGIN
  60. #define _XFUNCPROTOEND
  61. #endif
  62. #endif /* _XFUNCPROTOBEGIN */
  63. /* Added in X11R6.9, so available in any version of modular xproto */
  64. #if defined(__GNUC__) && (__GNUC__ >= 4)
  65. # define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
  66. #else
  67. # define _X_SENTINEL(x)
  68. #endif /* GNUC >= 4 */
  69. /* Added in X11R6.9, so available in any version of modular xproto */
  70. #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__) && !defined(__MINGW32__)
  71. # define _X_EXPORT __attribute__((visibility("default")))
  72. # define _X_HIDDEN __attribute__((visibility("hidden")))
  73. # define _X_INTERNAL __attribute__((visibility("internal")))
  74. #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
  75. # define _X_EXPORT __global
  76. # define _X_HIDDEN __hidden
  77. # define _X_INTERNAL __hidden
  78. #else /* not gcc >= 4 and not Sun Studio >= 8 */
  79. # define _X_EXPORT
  80. # define _X_HIDDEN
  81. # define _X_INTERNAL
  82. #endif /* GNUC >= 4 */
  83. /* requires xproto >= 7.0.9 */
  84. #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
  85. # define _X_LIKELY(x) __builtin_expect(!!(x), 1)
  86. # define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
  87. #else /* not gcc >= 3.3 */
  88. # define _X_LIKELY(x) (x)
  89. # define _X_UNLIKELY(x) (x)
  90. #endif
  91. /* Added in X11R6.9, so available in any version of modular xproto */
  92. #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)
  93. # define _X_DEPRECATED __attribute__((deprecated))
  94. #else /* not gcc >= 3.1 */
  95. # define _X_DEPRECATED
  96. #endif
  97. /* requires xproto >= 7.0.17 */
  98. #if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
  99. || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
  100. # define _X_NORETURN __attribute((noreturn))
  101. #else
  102. # define _X_NORETURN
  103. #endif /* GNUC */
  104. /* Added in X11R6.9, so available in any version of modular xproto */
  105. #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)
  106. # define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
  107. #else /* not gcc >= 2.3 */
  108. # define _X_ATTRIBUTE_PRINTF(x,y)
  109. #endif
  110. /* requires xproto >= 7.0.22 - since this uses either gcc or C99 variable
  111. argument macros, must be only used inside #ifdef _X_NONNULL guards, as
  112. many legacy X clients are compiled in C89 mode still. */
  113. #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
  114. #define _X_NONNULL(args...) __attribute__((nonnull(args)))
  115. #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */
  116. #define _X_NONNULL(...) /* */
  117. #endif
  118. /* requires xproto >= 7.0.22 */
  119. #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
  120. #define _X_UNUSED __attribute__((__unused__))
  121. #else
  122. #define _X_UNUSED /* */
  123. #endif
  124. /* C99 keyword "inline" or equivalent extensions in pre-C99 compilers */
  125. /* requires xproto >= 7.0.9
  126. (introduced in 7.0.8 but didn't support all compilers until 7.0.9) */
  127. #if defined(inline) /* assume autoconf set it correctly */ || \
  128. (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ || \
  129. (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550))
  130. # define _X_INLINE inline
  131. #elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
  132. # define _X_INLINE __inline__
  133. #else
  134. # define _X_INLINE
  135. #endif
  136. /* C99 keyword "restrict" or equivalent extensions in pre-C99 compilers */
  137. /* requires xproto >= 7.0.21 */
  138. #ifndef _X_RESTRICT_KYWD
  139. # if defined(restrict) /* assume autoconf set it correctly */ || \
  140. (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ \
  141. && !defined(__cplusplus)) /* Workaround g++ issue on Solaris */
  142. # define _X_RESTRICT_KYWD restrict
  143. # elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
  144. # define _X_RESTRICT_KYWD __restrict__
  145. # else
  146. # define _X_RESTRICT_KYWD
  147. # endif
  148. #endif
  149. #endif /* _XFUNCPROTO_H_ */