@@ -42,48 +42,56 @@ unsafe extern "C" {
42
42
#[ macro_export]
43
43
macro_rules! ijon_inc {
44
44
( $x: expr) => { {
45
- static mut loc: u32 = 0 ;
46
- if loc == 0 {
47
- let cfile = std:: ffi:: CString :: new( file!( ) ) . unwrap( ) ;
48
- loc = unsafe { ijon_hashstr( line!( ) , cfile. as_ptr( ) ) } ;
49
- }
50
- unsafe { ijon_inc( loc, $x) } ;
45
+ unsafe {
46
+ static mut loc: u32 = 0 ;
47
+ if loc == 0 {
48
+ let cfile = std:: ffi:: CString :: new( file!( ) ) . unwrap( ) ;
49
+ loc = ijon_hashstr( line!( ) , cfile. as_ptr( ) ) ;
50
+ }
51
+ ijon_inc( loc, $x)
52
+ } ;
51
53
} } ;
52
54
}
53
55
54
56
#[ macro_export]
55
57
macro_rules! ijon_max {
56
58
( $( $x: expr) ,+ $( , ) ?) => { {
59
+ unsafe {
57
60
static mut loc: u32 = 0 ;
58
61
if loc == 0 {
59
62
let cfile = std:: ffi:: CString :: new( file!( ) ) . unwrap( ) ;
60
- loc = unsafe { ijon_hashstr( line!( ) , cfile. as_ptr( ) ) } ;
63
+ loc = ijon_hashstr( line!( ) , cfile. as_ptr( ) ) ;
61
64
}
62
- unsafe { ijon_max_variadic( _IJON_LOC_CACHE, $( $x) ,+, 0u64 ) } ;
65
+ ijon_max_variadic( _IJON_LOC_CACHE, $( $x) ,+, 0u64 )
66
+ } ;
63
67
} } ;
64
68
}
65
69
66
70
#[ macro_export]
67
71
macro_rules! ijon_min {
68
72
( $( $x: expr) ,+ $( , ) ?) => { {
73
+ unsafe {
69
74
static mut loc: u32 = 0 ;
70
75
if loc == 0 {
71
76
let cfile = std:: ffi:: CString :: new( file!( ) ) . unwrap( ) ;
72
- loc = unsafe { ijon_hashstr( line!( ) , cfile. as_ptr( ) ) } ;
77
+ loc = ijon_hashstr( line!( ) , cfile. as_ptr( ) ) ;
73
78
}
74
- unsafe { ijon_min_variadic( loc, $( $x) ,+, 0u64 ) } ;
79
+ ijon_min_variadic( loc, $( $x) ,+, 0u64 )
80
+ } ;
75
81
} } ;
76
82
}
77
83
78
84
#[ macro_export]
79
85
macro_rules! ijon_set {
80
86
( $x: expr) => { {
81
- static mut loc: u32 = 0 ;
82
- if loc == 0 {
83
- let cfile = std:: ffi:: CString :: new( file!( ) ) . unwrap( ) ;
84
- loc = unsafe { ijon_hashstr( line!( ) , cfile. as_ptr( ) ) } ;
85
- }
86
- unsafe { ijon_set( loc, $x) } ;
87
+ unsafe {
88
+ static mut loc: u32 = 0 ;
89
+ if loc == 0 {
90
+ let cfile = std:: ffi:: CString :: new( file!( ) ) . unwrap( ) ;
91
+ loc = ijon_hashstr( line!( ) , cfile. as_ptr( ) ) ;
92
+ }
93
+ ijon_set( loc, $x)
94
+ } ;
87
95
} } ;
88
96
}
89
97
@@ -172,24 +180,28 @@ macro_rules! ijon_cmp {
172
180
#[ macro_export]
173
181
macro_rules! ijon_stack_max {
174
182
( $x: expr) => { {
175
- static mut loc: u32 = 0 ;
176
- if loc == 0 {
177
- let cfile = std:: ffi:: CString :: new( file!( ) ) . unwrap( ) ;
178
- loc = unsafe { ijon_hashstr( line!( ) , cfile. as_ptr( ) ) } ;
179
- }
180
- unsafe { ijon_max( ijon_hashint( loc, ijon_hashstack( ) ) , $x) } ;
183
+ unsafe {
184
+ static mut loc: u32 = 0 ;
185
+ if loc == 0 {
186
+ let cfile = std:: ffi:: CString :: new( file!( ) ) . unwrap( ) ;
187
+ loc = ijon_hashstr( line!( ) , cfile. as_ptr( ) ) ;
188
+ }
189
+ ijon_max( ijon_hashint( loc, ijon_hashstack( ) ) , $x)
190
+ } ;
181
191
} } ;
182
192
}
183
193
184
194
#[ macro_export]
185
195
macro_rules! ijon_stack_min {
186
196
( $x: expr) => { {
187
- static mut loc: u32 = 0 ;
188
- if loc == 0 {
189
- let cfile = std:: ffi:: CString :: new( file!( ) ) . unwrap( ) ;
190
- loc = unsafe { ijon_hashstr( line!( ) , cfile. as_ptr( ) ) } ;
191
- }
192
- unsafe { ijon_min( ijon_hashint( loc, ijon_hashstack( ) ) , $x) } ;
197
+ unsafe {
198
+ static mut loc: u32 = 0 ;
199
+ if loc == 0 {
200
+ let cfile = std:: ffi:: CString :: new( file!( ) ) . unwrap( ) ;
201
+ loc = ijon_hashstr( line!( ) , cfile. as_ptr( ) ) ;
202
+ }
203
+ ijon_min( ijon_hashint( loc, ijon_hashstack( ) ) , $x)
204
+ } ;
193
205
} } ;
194
206
}
195
207
0 commit comments