File indexing completed on 2025-01-18 10:13:16
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 #ifndef _UNISTRING_CDEFS_H
0027 #define _UNISTRING_CDEFS_H
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 #ifndef _GL_UNUSED_PARAMETER
0040 # define _GL_UNUSED_PARAMETER _UC_ATTRIBUTE_MAYBE_UNUSED
0041 #endif
0042
0043 #ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
0044 # define _GL_ATTRIBUTE_MAYBE_UNUSED _UC_ATTRIBUTE_MAYBE_UNUSED
0045 #endif
0046
0047 #ifndef _GL_ATTRIBUTE_MALLOC
0048 # define _GL_ATTRIBUTE_MALLOC _UC_ATTRIBUTE_MALLOC
0049 #endif
0050
0051
0052
0053
0054
0055
0056
0057 #ifndef _GL_ATTRIBUTE_DEALLOC
0058 # define _GL_ATTRIBUTE_DEALLOC _UC_ATTRIBUTE_DEALLOC
0059 #endif
0060 #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
0061 # define _GL_ATTRIBUTE_DEALLOC_FREE _UC_ATTRIBUTE_DEALLOC_FREE
0062 #endif
0063
0064
0065
0066
0067
0068 #if defined __GNUC__ && defined __GNUC_MINOR__
0069 # define _UC_GNUC_PREREQ(major, minor) \
0070 ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
0071 #else
0072 # define _UC_GNUC_PREREQ(major, minor) 0
0073 #endif
0074
0075 #if (defined __has_attribute \
0076 && (!defined __clang_minor__ \
0077 || (defined __apple_build_version__ \
0078 ? 6000000 <= __apple_build_version__ \
0079 : 5 <= __clang_major__)))
0080 # define _UC_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
0081 #else
0082 # define _UC_HAS_ATTRIBUTE(attr) _UC_ATTR_##attr
0083 # define _UC_ATTR_malloc _UC_GNUC_PREREQ (3, 0)
0084 # define _UC_ATTR_unused _UC_GNUC_PREREQ (2, 7)
0085 #endif
0086
0087 #ifdef __cplusplus
0088 # if defined __clang__
0089 # define _UC_BRACKET_BEFORE_ATTRIBUTE 1
0090 # endif
0091 #else
0092 # if defined __GNUC__ && !defined __clang__
0093 # define _UC_BRACKET_BEFORE_ATTRIBUTE 1
0094 # endif
0095 #endif
0096
0097 #if _UC_GNUC_PREREQ (11, 0)
0098 # define _UC_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
0099 #else
0100 # define _UC_ATTRIBUTE_DEALLOC(f, i)
0101 #endif
0102 #if defined __cplusplus && defined __GNUC__ && !defined __clang__
0103
0104 # define _UC_ATTRIBUTE_DEALLOC_FREE \
0105 _UC_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
0106 #else
0107 # define _UC_ATTRIBUTE_DEALLOC_FREE \
0108 _UC_ATTRIBUTE_DEALLOC (free, 1)
0109 #endif
0110
0111 #if _UC_HAS_ATTRIBUTE (malloc)
0112 # define _UC_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
0113 #else
0114 # define _UC_ATTRIBUTE_MALLOC
0115 #endif
0116
0117 #ifndef _UC_BRACKET_BEFORE_ATTRIBUTE
0118 # if defined __clang__ && defined __cplusplus
0119 # if !defined __apple_build_version__ && __clang_major__ >= 10
0120 # define _UC_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
0121 # endif
0122 # elif defined __has_c_attribute
0123 # if __has_c_attribute (__maybe_unused__)
0124 # define _UC_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
0125 # endif
0126 # endif
0127 #endif
0128 #ifndef _UC_ATTRIBUTE_MAYBE_UNUSED
0129 # define _UC_ATTRIBUTE_MAYBE_UNUSED _UC_ATTRIBUTE_UNUSED
0130 #endif
0131
0132 #if _UC_HAS_ATTRIBUTE (unused)
0133 # define _UC_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
0134 #else
0135 # define _UC_ATTRIBUTE_UNUSED
0136 #endif
0137
0138 #endif