84
84
# define INDEXSTORE_NOESCAPE
85
85
#endif
86
86
87
+ #if __has_attribute (flag_enum )
88
+ # define INDEXSTORE_FLAG_ENUM_ATTR __attribute__((flag_enum))
89
+ #else
90
+ # define INDEXSTORE_FLAG_ENUM_ATTR
91
+ #endif
92
+
93
+ #if __has_attribute (enum_extensibility )
94
+ # define INDEXSTORE_OPEN_ENUM_ATTR __attribute__((enum_extensibility(open)))
95
+ #else
96
+ # define INDEXSTORE_OPEN_ENUM_ATTR
97
+ #endif
98
+
99
+ #define INDEXSTORE_OPTIONS_ATTRS INDEXSTORE_OPEN_ENUM_ATTR INDEXSTORE_FLAG_ENUM_ATTR
100
+
101
+ #if __has_extension (cxx_strong_enums ) || __has_feature (objc_fixed_enum )
102
+ # define INDEXSTORE_OPTIONS (_type , _name ) enum INDEXSTORE_OPTIONS_ATTRS _name : _type _name; enum INDEXSTORE_OPTIONS_ATTRS _name : _type
103
+ #else
104
+ # define INDEXSTORE_OPTIONS (_type , _name ) _type _name; enum INDEXSTORE_OPTIONS_ATTRS
105
+ #endif
106
+
87
107
INDEXSTORE_BEGIN_DECLS
88
108
89
109
typedef void * indexstore_error_t ;
@@ -266,7 +286,7 @@ typedef enum {
266
286
INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMODIFY = 1015 ,
267
287
} indexstore_symbol_subkind_t ;
268
288
269
- typedef enum {
289
+ typedef INDEXSTORE_OPTIONS ( uint64_t , indexstore_symbol_property_t ) {
270
290
INDEXSTORE_SYMBOL_PROPERTY_GENERIC = 1 << 0 ,
271
291
INDEXSTORE_SYMBOL_PROPERTY_TEMPLATE_PARTIAL_SPECIALIZATION = 1 << 1 ,
272
292
INDEXSTORE_SYMBOL_PROPERTY_TEMPLATE_SPECIALIZATION = 1 << 2 ,
@@ -276,7 +296,7 @@ typedef enum {
276
296
INDEXSTORE_SYMBOL_PROPERTY_GKINSPECTABLE = 1 << 6 ,
277
297
INDEXSTORE_SYMBOL_PROPERTY_LOCAL = 1 << 7 ,
278
298
INDEXSTORE_SYMBOL_PROPERTY_PROTOCOL_INTERFACE = 1 << 8 ,
279
- } indexstore_symbol_property_t ;
299
+ };
280
300
281
301
typedef enum {
282
302
INDEXSTORE_SYMBOL_LANG_C = 0 ,
@@ -286,7 +306,7 @@ typedef enum {
286
306
INDEXSTORE_SYMBOL_LANG_SWIFT = 100 ,
287
307
} indexstore_symbol_language_t ;
288
308
289
- typedef enum {
309
+ typedef INDEXSTORE_OPTIONS ( uint64_t , indexstore_symbol_role_t ) {
290
310
INDEXSTORE_SYMBOL_ROLE_DECLARATION = 1 << 0 ,
291
311
INDEXSTORE_SYMBOL_ROLE_DEFINITION = 1 << 1 ,
292
312
INDEXSTORE_SYMBOL_ROLE_REFERENCE = 1 << 2 ,
@@ -310,7 +330,7 @@ typedef enum {
310
330
INDEXSTORE_SYMBOL_ROLE_REL_CONTAINEDBY = 1 << 16 ,
311
331
INDEXSTORE_SYMBOL_ROLE_REL_IBTYPEOF = 1 << 17 ,
312
332
INDEXSTORE_SYMBOL_ROLE_REL_SPECIALIZATIONOF = 1 << 18 ,
313
- } indexstore_symbol_role_t ;
333
+ };
314
334
315
335
INDEXSTORE_PUBLIC indexstore_symbol_language_t
316
336
indexstore_symbol_get_language (indexstore_symbol_t );
@@ -321,13 +341,13 @@ indexstore_symbol_get_kind(indexstore_symbol_t);
321
341
INDEXSTORE_PUBLIC indexstore_symbol_subkind_t
322
342
indexstore_symbol_get_subkind (indexstore_symbol_t );
323
343
324
- INDEXSTORE_PUBLIC uint64_t
344
+ INDEXSTORE_PUBLIC indexstore_symbol_property_t
325
345
indexstore_symbol_get_properties (indexstore_symbol_t );
326
346
327
- INDEXSTORE_PUBLIC uint64_t
347
+ INDEXSTORE_PUBLIC indexstore_symbol_role_t
328
348
indexstore_symbol_get_roles (indexstore_symbol_t );
329
349
330
- INDEXSTORE_PUBLIC uint64_t
350
+ INDEXSTORE_PUBLIC indexstore_symbol_role_t
331
351
indexstore_symbol_get_related_roles (indexstore_symbol_t );
332
352
333
353
INDEXSTORE_PUBLIC indexstore_string_ref_t
@@ -341,7 +361,7 @@ indexstore_symbol_get_codegen_name(indexstore_symbol_t);
341
361
342
362
typedef void * indexstore_symbol_relation_t ;
343
363
344
- INDEXSTORE_PUBLIC uint64_t
364
+ INDEXSTORE_PUBLIC indexstore_symbol_role_t
345
365
indexstore_symbol_relation_get_roles (indexstore_symbol_relation_t );
346
366
347
367
INDEXSTORE_PUBLIC indexstore_symbol_t
@@ -363,7 +383,7 @@ indexstore_occurrence_relations_apply_f(indexstore_occurrence_t,
363
383
void * context ,
364
384
INDEXSTORE_NOESCAPE bool (* applier )(void * context , indexstore_symbol_relation_t symbol_rel ));
365
385
366
- INDEXSTORE_PUBLIC uint64_t
386
+ INDEXSTORE_PUBLIC indexstore_symbol_role_t
367
387
indexstore_occurrence_get_roles (indexstore_occurrence_t );
368
388
369
389
INDEXSTORE_PUBLIC void
0 commit comments