File indexing completed on 2024-05-18 08:29:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef _ANSIDECL_H
0037 #define _ANSIDECL_H 1
0038
0039 #ifdef __cplusplus
0040 extern "C" {
0041 #endif
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 #ifndef GCC_VERSION
0062 #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
0063 #endif
0064
0065 #if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
0066
0067
0068
0069
0070
0071
0072
0073 #define PTR void *
0074
0075 #undef const
0076 #undef volatile
0077 #undef signed
0078
0079
0080
0081 #undef inline
0082 #if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__))
0083
0084 #else
0085 # if GCC_VERSION >= 2007
0086 # define inline __inline__
0087 # else
0088 # define inline
0089 # endif
0090 #endif
0091
0092 #else
0093
0094 #define PTR char *
0095
0096
0097 #undef const
0098 #undef volatile
0099 #undef signed
0100 #undef inline
0101 #define const
0102 #define volatile
0103 #define signed
0104 #define inline
0105
0106 #endif
0107
0108
0109
0110
0111
0112 #if (GCC_VERSION < 2007)
0113 # define __attribute__(x)
0114 #endif
0115
0116
0117 #ifndef ATTRIBUTE_MALLOC
0118 # if (GCC_VERSION >= 2096)
0119 # define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
0120 # else
0121 # define ATTRIBUTE_MALLOC
0122 # endif
0123 #endif
0124
0125
0126
0127 #ifndef ATTRIBUTE_UNUSED_LABEL
0128 # ifndef __cplusplus
0129 # if GCC_VERSION >= 2093
0130 # define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
0131 # else
0132 # define ATTRIBUTE_UNUSED_LABEL
0133 # endif
0134 # else
0135 # if GCC_VERSION >= 4005
0136 # define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED ;
0137 # else
0138 # define ATTRIBUTE_UNUSED_LABEL
0139 # endif
0140 # endif
0141 #endif
0142
0143
0144
0145
0146 #ifndef ATTRIBUTE_UNUSED
0147 #if GCC_VERSION >= 3004
0148 # define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
0149 #else
0150 #define ATTRIBUTE_UNUSED
0151 #endif
0152 #endif
0153
0154
0155
0156 #if ! defined(__cplusplus) || (GCC_VERSION >= 3004)
0157 # define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED
0158 #else
0159 # define ARG_UNUSED(NAME) NAME
0160 #endif
0161
0162 #ifndef ATTRIBUTE_NORETURN
0163 #define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
0164 #endif
0165
0166
0167 #ifndef ATTRIBUTE_NONNULL
0168 # if (GCC_VERSION >= 3003)
0169 # define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
0170 # else
0171 # define ATTRIBUTE_NONNULL(m)
0172 # endif
0173 #endif
0174
0175
0176 #ifndef ATTRIBUTE_RETURNS_NONNULL
0177 # if (GCC_VERSION >= 4009)
0178 # define ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
0179 # else
0180 # define ATTRIBUTE_RETURNS_NONNULL
0181 # endif
0182 #endif
0183
0184
0185 #ifndef ATTRIBUTE_PURE
0186 # if (GCC_VERSION >= 3000)
0187 # define ATTRIBUTE_PURE __attribute__ ((__pure__))
0188 # else
0189 # define ATTRIBUTE_PURE
0190 # endif
0191 #endif
0192
0193
0194
0195
0196
0197 #ifndef ATTRIBUTE_PRINTF
0198 #define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)
0199 #define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
0200 #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
0201 #define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
0202 #define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
0203 #define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
0204 #endif
0205
0206
0207
0208
0209 #ifndef ATTRIBUTE_FPTR_PRINTF
0210 # if (GCC_VERSION >= 3001)
0211 # define ATTRIBUTE_FPTR_PRINTF(m, n) ATTRIBUTE_PRINTF(m, n)
0212 # else
0213 # define ATTRIBUTE_FPTR_PRINTF(m, n)
0214 # endif
0215 # define ATTRIBUTE_FPTR_PRINTF_1 ATTRIBUTE_FPTR_PRINTF(1, 2)
0216 # define ATTRIBUTE_FPTR_PRINTF_2 ATTRIBUTE_FPTR_PRINTF(2, 3)
0217 # define ATTRIBUTE_FPTR_PRINTF_3 ATTRIBUTE_FPTR_PRINTF(3, 4)
0218 # define ATTRIBUTE_FPTR_PRINTF_4 ATTRIBUTE_FPTR_PRINTF(4, 5)
0219 # define ATTRIBUTE_FPTR_PRINTF_5 ATTRIBUTE_FPTR_PRINTF(5, 6)
0220 #endif
0221
0222
0223
0224 #ifndef ATTRIBUTE_NULL_PRINTF
0225 # if (GCC_VERSION >= 3003)
0226 # define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
0227 # else
0228 # define ATTRIBUTE_NULL_PRINTF(m, n)
0229 # endif
0230 # define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2)
0231 # define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3)
0232 # define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4)
0233 # define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5)
0234 # define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
0235 #endif
0236
0237
0238 #ifndef ATTRIBUTE_SENTINEL
0239 # if (GCC_VERSION >= 3005)
0240 # define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
0241 # else
0242 # define ATTRIBUTE_SENTINEL
0243 # endif
0244 #endif
0245
0246
0247 #ifndef ATTRIBUTE_ALIGNED_ALIGNOF
0248 # if (GCC_VERSION >= 3000)
0249 # define ATTRIBUTE_ALIGNED_ALIGNOF(m) __attribute__ ((__aligned__ (__alignof__ (m))))
0250 # else
0251 # define ATTRIBUTE_ALIGNED_ALIGNOF(m)
0252 # endif
0253 #endif
0254
0255
0256
0257 #ifndef ATTRIBUTE_PACKED
0258 # define ATTRIBUTE_PACKED __attribute__ ((packed))
0259 #endif
0260
0261
0262 #ifndef ATTRIBUTE_COLD
0263 # if (GCC_VERSION >= 4003)
0264 # define ATTRIBUTE_COLD __attribute__ ((__cold__))
0265 # else
0266 # define ATTRIBUTE_COLD
0267 # endif
0268 #endif
0269 #ifndef ATTRIBUTE_HOT
0270 # if (GCC_VERSION >= 4003)
0271 # define ATTRIBUTE_HOT __attribute__ ((__hot__))
0272 # else
0273 # define ATTRIBUTE_HOT
0274 # endif
0275 #endif
0276
0277
0278 #ifndef ATTRIBUTE_NO_SANITIZE_UNDEFINED
0279 # if (GCC_VERSION >= 4009)
0280 # define ATTRIBUTE_NO_SANITIZE_UNDEFINED __attribute__ ((no_sanitize_undefined))
0281 # else
0282 # define ATTRIBUTE_NO_SANITIZE_UNDEFINED
0283 # endif
0284 #endif
0285
0286
0287 #ifndef ATTRIBUTE_NONSTRING
0288 # if GCC_VERSION >= 8000
0289 # define ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
0290 # else
0291 # define ATTRIBUTE_NONSTRING
0292 # endif
0293 #endif
0294
0295
0296 #ifndef ATTRIBUTE_RESULT_SIZE_1
0297 # if (GCC_VERSION >= 4003)
0298 # define ATTRIBUTE_RESULT_SIZE_1 __attribute__ ((alloc_size (1)))
0299 # else
0300 # define ATTRIBUTE_RESULT_SIZE_1
0301 #endif
0302 #endif
0303
0304 #ifndef ATTRIBUTE_RESULT_SIZE_2
0305 # if (GCC_VERSION >= 4003)
0306 # define ATTRIBUTE_RESULT_SIZE_2 __attribute__ ((alloc_size (2)))
0307 # else
0308 # define ATTRIBUTE_RESULT_SIZE_2
0309 #endif
0310 #endif
0311
0312 #ifndef ATTRIBUTE_RESULT_SIZE_1_2
0313 # if (GCC_VERSION >= 4003)
0314 # define ATTRIBUTE_RESULT_SIZE_1_2 __attribute__ ((alloc_size (1, 2)))
0315 # else
0316 # define ATTRIBUTE_RESULT_SIZE_1_2
0317 #endif
0318 #endif
0319
0320
0321 #ifndef ATTRIBUTE_WARN_UNUSED_RESULT
0322 # if GCC_VERSION >= 3003
0323 # define ATTRIBUTE_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
0324 # else
0325 # define ATTRIBUTE_WARN_UNUSED_RESULT
0326 # endif
0327 #endif
0328
0329
0330
0331
0332 #if GCC_VERSION < 2008
0333 #define __extension__
0334 #endif
0335
0336
0337
0338
0339
0340
0341
0342 #ifdef __cplusplus
0343 #define EXPORTED_CONST extern const
0344 #else
0345 #define EXPORTED_CONST const
0346 #endif
0347
0348
0349
0350
0351 #ifdef __cplusplus
0352 #define ENUM_BITFIELD(TYPE) enum TYPE
0353 #elif (GCC_VERSION > 2000)
0354 #define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
0355 #else
0356 #define ENUM_BITFIELD(TYPE) unsigned int
0357 #endif
0358
0359 #if __cpp_constexpr >= 200704
0360 #define CONSTEXPR constexpr
0361 #else
0362 #define CONSTEXPR
0363 #endif
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380 #if defined __cplusplus
0381 # if __cplusplus >= 201103
0382
0383
0384 # if GCC_VERSION < 4007
0385 # define OVERRIDE
0386 # define FINAL
0387 # else
0388 # define OVERRIDE override
0389 # define FINAL final
0390 # endif
0391 # elif GCC_VERSION >= 4007
0392
0393 # define OVERRIDE
0394 # define FINAL __final
0395 # else
0396
0397 # define OVERRIDE
0398 # define FINAL
0399 # endif
0400 #else
0401
0402 # define OVERRIDE
0403 # define FINAL
0404 #endif
0405
0406
0407
0408
0409
0410
0411
0412
0413
0414
0415
0416
0417
0418
0419
0420
0421
0422 #if __cplusplus >= 201103
0423 #define DISABLE_COPY_AND_ASSIGN(TYPE) \
0424 TYPE (const TYPE&) = delete; \
0425 void operator= (const TYPE &) = delete
0426 #else
0427 #define DISABLE_COPY_AND_ASSIGN(TYPE) \
0428 TYPE (const TYPE&); \
0429 void operator= (const TYPE &)
0430 #endif
0431
0432 #ifdef __cplusplus
0433 }
0434 #endif
0435
0436 #endif