48
48
#define CINDEX_VERSION_STRING \
49
49
CINDEX_VERSION_STRINGIZE(CINDEX_VERSION_MAJOR, CINDEX_VERSION_MINOR)
50
50
51
+ #ifndef __has_feature
52
+ #define __has_feature (feature ) 0
53
+ #endif
54
+
51
55
LLVM_CLANG_C_EXTERN_C_BEGIN
52
56
53
57
/** \defgroup CINDEX libclang: C Interface to Clang
@@ -3687,8 +3691,6 @@ typedef enum CXChildVisitResult (*CXCursorVisitor)(CXCursor cursor,
3687
3691
CINDEX_LINKAGE unsigned clang_visitChildren (CXCursor parent ,
3688
3692
CXCursorVisitor visitor ,
3689
3693
CXClientData client_data );
3690
- #ifdef __has_feature
3691
- #if __has_feature (blocks )
3692
3694
/**
3693
3695
* Visitor invoked for each cursor found by a traversal.
3694
3696
*
@@ -3699,17 +3701,19 @@ CINDEX_LINKAGE unsigned clang_visitChildren(CXCursor parent,
3699
3701
* The visitor should return one of the \c CXChildVisitResult values
3700
3702
* to direct clang_visitChildrenWithBlock().
3701
3703
*/
3704
+ #if __has_feature (blocks )
3702
3705
typedef enum CXChildVisitResult (^CXCursorVisitorBlock )(CXCursor cursor ,
3703
3706
CXCursor parent );
3707
+ #else
3708
+ typedef struct _CXChildVisitResult * CXCursorVisitorBlock ;
3709
+ #endif
3704
3710
3705
3711
/**
3706
3712
* Visits the children of a cursor using the specified block. Behaves
3707
3713
* identically to clang_visitChildren() in all other respects.
3708
3714
*/
3709
3715
CINDEX_LINKAGE unsigned
3710
3716
clang_visitChildrenWithBlock (CXCursor parent , CXCursorVisitorBlock block );
3711
- #endif
3712
- #endif
3713
3717
3714
3718
/**
3715
3719
* @}
@@ -5615,11 +5619,12 @@ CINDEX_LINKAGE CXResult clang_findReferencesInFile(
5615
5619
CINDEX_LINKAGE CXResult clang_findIncludesInFile (
5616
5620
CXTranslationUnit TU , CXFile file , CXCursorAndRangeVisitor visitor );
5617
5621
5618
- #ifdef __has_feature
5619
5622
#if __has_feature (blocks )
5620
-
5621
5623
typedef enum CXVisitorResult (^CXCursorAndRangeVisitorBlock )(CXCursor ,
5622
5624
CXSourceRange );
5625
+ #else
5626
+ typedef struct _CXCursorAndRangeVisitorBlock * CXCursorAndRangeVisitorBlock ;
5627
+ #endif
5623
5628
5624
5629
CINDEX_LINKAGE
5625
5630
CXResult clang_findReferencesInFileWithBlock (CXCursor , CXFile ,
@@ -5629,9 +5634,6 @@ CINDEX_LINKAGE
5629
5634
CXResult clang_findIncludesInFileWithBlock (CXTranslationUnit , CXFile ,
5630
5635
CXCursorAndRangeVisitorBlock );
5631
5636
5632
- #endif
5633
- #endif
5634
-
5635
5637
/**
5636
5638
* The client's data object that is associated with a CXFile.
5637
5639
*/
0 commit comments