1- #[ cfg( ocvrs_opencv_branch_34) ]
2- #[ doc( hidden) ]
3- #[ macro_export]
4- macro_rules! opencv_branch_34 {
5- ( $( $tt: tt) * ) => { $( $tt) * }
6- }
7-
81/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
92/// # Examples
103///
@@ -27,47 +20,12 @@ macro_rules! opencv_branch_34 {
2720/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
2821/// }
2922/// ```
30- #[ cfg( not ( ocvrs_opencv_branch_34 ) ) ]
23+ #[ cfg( ocvrs_opencv_branch_OPENCV_BRANCH ) ]
3124#[ macro_export]
32- macro_rules! opencv_branch_34 {
33- ( $( $tt: tt) * ) => { } ;
34- }
35-
36- /// Conditional compilation macro based on OpenCV branch version for usage in external crates.
37- /// # Examples
38- ///
39- /// Alternative import:
40- /// ```
41- /// opencv::not_opencv_branch_34! {
42- /// use opencv::imgproc::LINE_8;
43- /// }
44- /// opencv::opencv_branch_34! {
45- /// use opencv::core::LINE_8;
46- /// }
47- /// ```
48- ///
49- /// Alternative function call:
50- /// ```
51- /// opencv::opencv_branch_34! {
52- /// let mut cam = opencv::videoio::VideoCapture::new_default(0)?;
53- /// }
54- /// opencv::not_opencv_branch_34! {
55- /// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
56- /// }
57- /// ```
58- #[ cfg( not( ocvrs_opencv_branch_34) ) ]
59- #[ macro_export]
60- macro_rules! not_opencv_branch_34 {
25+ macro_rules! opencv_branch_OPENCV_BRANCH {
6126 ( $( $tt: tt) * ) => { $( $tt) * }
6227}
6328
64- #[ cfg( ocvrs_opencv_branch_34) ]
65- #[ doc( hidden) ]
66- #[ macro_export]
67- macro_rules! not_opencv_branch_34 {
68- ( $( $tt: tt) * ) => { } ;
69- }
70-
7129/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
7230/// # Examples
7331///
@@ -90,26 +48,12 @@ macro_rules! not_opencv_branch_34 {
9048/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
9149/// }
9250/// ```
93- #[ cfg( ocvrs_opencv_branch_4) ]
94- #[ macro_export]
95- macro_rules! opencv_branch_4 {
96- ( $( $tt: tt) * ) => { $( $tt) * }
97- }
98-
99- #[ cfg( not( ocvrs_opencv_branch_4) ) ]
100- #[ doc( hidden) ]
51+ #[ cfg( not( ocvrs_opencv_branch_OPENCV_BRANCH) ) ]
10152#[ macro_export]
102- macro_rules! opencv_branch_4 {
53+ macro_rules! opencv_branch_OPENCV_BRANCH {
10354 ( $( $tt: tt) * ) => { } ;
10455}
10556
106- #[ cfg( not( ocvrs_opencv_branch_4) ) ]
107- #[ doc( hidden) ]
108- #[ macro_export]
109- macro_rules! not_opencv_branch_4 {
110- ( $( $tt: tt) * ) => { $( $tt) * }
111- }
112-
11357/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
11458/// # Examples
11559///
@@ -132,51 +76,9 @@ macro_rules! not_opencv_branch_4 {
13276/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
13377/// }
13478/// ```
135- #[ cfg( ocvrs_opencv_branch_4) ]
136- #[ macro_export]
137- macro_rules! not_opencv_branch_4 {
138- ( $( $tt: tt) * ) => { } ;
139- }
140-
141- /// Conditional compilation macro based on OpenCV branch version for usage in external crates.
142- /// # Examples
143- ///
144- /// Alternative import:
145- /// ```
146- /// opencv::opencv_branch_4! {
147- /// use opencv::imgproc::LINE_8;
148- /// }
149- /// opencv::not_opencv_branch_4! {
150- /// use opencv::core::LINE_8;
151- /// }
152- /// ```
153- ///
154- /// Alternative function call:
155- /// ```
156- /// opencv::opencv_branch_34! {
157- /// let mut cam = opencv::videoio::VideoCapture::new_default(0)?;
158- /// }
159- /// opencv::not_opencv_branch_34! {
160- /// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
161- /// }
162- /// ```
163- #[ cfg( ocvrs_opencv_branch_5) ]
164- #[ macro_export]
165- macro_rules! opencv_branch_5 {
166- ( $( $tt: tt) * ) => { $( $tt) * }
167- }
168-
169- #[ cfg( not( ocvrs_opencv_branch_5) ) ]
170- #[ doc( hidden) ]
171- #[ macro_export]
172- macro_rules! opencv_branch_5 {
173- ( $( $tt: tt) * ) => { } ;
174- }
175-
176- #[ cfg( not( ocvrs_opencv_branch_5) ) ]
177- #[ doc( hidden) ]
79+ #[ cfg( not( ocvrs_opencv_branch_OPENCV_BRANCH) ) ]
17880#[ macro_export]
179- macro_rules! not_opencv_branch_5 {
81+ macro_rules! not_opencv_branch_OPENCV_BRANCH {
18082 ( $( $tt: tt) * ) => { $( $tt) * }
18183}
18284
@@ -202,8 +104,8 @@ macro_rules! not_opencv_branch_5 {
202104/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
203105/// }
204106/// ```
205- #[ cfg( ocvrs_opencv_branch_5 ) ]
107+ #[ cfg( ocvrs_opencv_branch_OPENCV_BRANCH ) ]
206108#[ macro_export]
207- macro_rules! not_opencv_branch_5 {
109+ macro_rules! not_opencv_branch_OPENCV_BRANCH {
208110 ( $( $tt: tt) * ) => { } ;
209111}
0 commit comments