30
30
#![ cfg_attr( feature="clippy" , plugin( clippy) ) ]
31
31
#![ cfg_attr( feature="clippy" , warn( clippy) ) ]
32
32
33
- #[ macro_use]
34
- extern crate bitflags;
35
-
36
33
extern crate glob;
37
34
extern crate libc;
38
35
#[ cfg( feature="runtime" ) ]
@@ -66,6 +63,13 @@ macro_rules! cenum {
66
63
} ) => (
67
64
pub type $name = c_int;
68
65
66
+ $( $( #[ $vmeta] ) * pub const $variant: $name = $value; ) +
67
+ ) ;
68
+ ( $( #[ $meta: meta] ) * enum $name: ident {
69
+ $( $( #[ $vmeta: meta] ) * const $variant: ident = $value: expr) ; +;
70
+ } ) => (
71
+ pub type $name = c_int;
72
+
69
73
$( $( #[ $vmeta] ) * pub const $variant: $name = $value; ) +
70
74
) ;
71
75
}
@@ -890,18 +894,16 @@ cenum! {
890
894
// Flags
891
895
//================================================
892
896
893
- bitflags ! {
894
- #[ repr( C ) ]
895
- pub struct CXCodeComplete_Flags : c_uint {
897
+ cenum ! {
898
+ enum CXCodeComplete_Flags {
896
899
const CXCodeComplete_IncludeMacros = 1 ;
897
900
const CXCodeComplete_IncludeCodePatterns = 2 ;
898
901
const CXCodeComplete_IncludeBriefComments = 4 ;
899
902
}
900
903
}
901
904
902
- bitflags ! {
903
- #[ repr( C ) ]
904
- pub struct CXCompletionContext : c_uint {
905
+ cenum ! {
906
+ enum CXCompletionContext {
905
907
const CXCompletionContext_Unexposed = 0 ;
906
908
const CXCompletionContext_AnyType = 1 ;
907
909
const CXCompletionContext_AnyValue = 2 ;
@@ -929,9 +931,8 @@ bitflags! {
929
931
}
930
932
}
931
933
932
- bitflags ! {
933
- #[ repr( C ) ]
934
- pub struct CXDiagnosticDisplayOptions : c_uint {
934
+ cenum ! {
935
+ enum CXDiagnosticDisplayOptions {
935
936
const CXDiagnostic_DisplaySourceLocation = 1 ;
936
937
const CXDiagnostic_DisplayColumn = 2 ;
937
938
const CXDiagnostic_DisplaySourceRanges = 4 ;
@@ -941,26 +942,23 @@ bitflags! {
941
942
}
942
943
}
943
944
944
- bitflags ! {
945
- #[ repr( C ) ]
946
- pub struct CXGlobalOptFlags : c_uint {
945
+ cenum ! {
946
+ enum CXGlobalOptFlags {
947
947
const CXGlobalOpt_None = 0 ;
948
948
const CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1 ;
949
949
const CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2 ;
950
950
const CXGlobalOpt_ThreadBackgroundPriorityForAll = 3 ;
951
951
}
952
952
}
953
953
954
- bitflags ! {
955
- #[ repr( C ) ]
956
- pub struct CXIdxDeclInfoFlags : c_uint {
954
+ cenum ! {
955
+ enum CXIdxDeclInfoFlags {
957
956
const CXIdxDeclFlag_Skipped = 1 ;
958
957
}
959
958
}
960
959
961
- bitflags ! {
962
- #[ repr( C ) ]
963
- pub struct CXIndexOptFlags : c_uint {
960
+ cenum ! {
961
+ enum CXIndexOptFlags {
964
962
const CXIndexOptNone = 0 ;
965
963
const CXIndexOptSuppressRedundantRefs = 1 ;
966
964
const CXIndexOptIndexFunctionLocalSymbols = 2 ;
@@ -970,18 +968,16 @@ bitflags! {
970
968
}
971
969
}
972
970
973
- bitflags ! {
974
- #[ repr( C ) ]
975
- pub struct CXNameRefFlags : c_uint {
971
+ cenum ! {
972
+ enum CXNameRefFlags {
976
973
const CXNameRange_WantQualifier = 1 ;
977
974
const CXNameRange_WantTemplateArgs = 2 ;
978
975
const CXNameRange_WantSinglePiece = 4 ;
979
976
}
980
977
}
981
978
982
- bitflags ! {
983
- #[ repr( C ) ]
984
- pub struct CXObjCDeclQualifierKind : c_uint {
979
+ cenum ! {
980
+ enum CXObjCDeclQualifierKind {
985
981
const CXObjCDeclQualifier_None = 0 ;
986
982
const CXObjCDeclQualifier_In = 1 ;
987
983
const CXObjCDeclQualifier_Inout = 2 ;
@@ -992,9 +988,8 @@ bitflags! {
992
988
}
993
989
}
994
990
995
- bitflags ! {
996
- #[ repr( C ) ]
997
- pub struct CXObjCPropertyAttrKind : c_uint {
991
+ cenum ! {
992
+ enum CXObjCPropertyAttrKind {
998
993
const CXObjCPropertyAttr_noattr = 0 ;
999
994
const CXObjCPropertyAttr_readonly = 1 ;
1000
995
const CXObjCPropertyAttr_getter = 2 ;
@@ -1013,23 +1008,20 @@ bitflags! {
1013
1008
}
1014
1009
}
1015
1010
1016
- bitflags ! {
1017
- #[ repr( C ) ]
1018
- pub struct CXReparse_Flags : c_uint {
1011
+ cenum ! {
1012
+ enum CXReparse_Flags {
1019
1013
const CXReparse_None = 0 ;
1020
1014
}
1021
1015
}
1022
1016
1023
- bitflags ! {
1024
- #[ repr( C ) ]
1025
- pub struct CXSaveTranslationUnit_Flags : c_uint {
1017
+ cenum ! {
1018
+ enum CXSaveTranslationUnit_Flags {
1026
1019
const CXSaveTranslationUnit_None = 0 ;
1027
1020
}
1028
1021
}
1029
1022
1030
- bitflags ! {
1031
- #[ repr( C ) ]
1032
- pub struct CXTranslationUnit_Flags : c_uint {
1023
+ cenum ! {
1024
+ enum CXTranslationUnit_Flags {
1033
1025
const CXTranslationUnit_None = 0 ;
1034
1026
const CXTranslationUnit_DetailedPreprocessingRecord = 1 ;
1035
1027
const CXTranslationUnit_Incomplete = 2 ;
0 commit comments