@@ -199,8 +199,8 @@ macro_rules! e {
199
199
// cfg completely.
200
200
// FIXME(ctest): ctest can't handle `$(,)?` so we use `$(,)*` which isn't quite correct.
201
201
cfg_if ! {
202
- if #[ cfg( feature = "const-extern-fn" ) ] {
203
- /// Define an `unsafe` function that is const as long as `const-extern-fn` is enabled.
202
+ if #[ cfg( not ( libc_ctest ) ) ] {
203
+ /// Define an `unsafe` function that is not const for `ctest`
204
204
macro_rules! f {
205
205
( $(
206
206
$( #[ $attr: meta] ) *
@@ -209,12 +209,12 @@ cfg_if! {
209
209
) * ) => ( $(
210
210
#[ inline]
211
211
$( #[ $attr] ) *
212
- pub $ ( $constness ) * unsafe extern fn $i( $( $arg: $argty) , * ) -> $ret
212
+ pub unsafe extern fn $i( $( $arg: $argty) , * ) -> $ret
213
213
$body
214
214
) * )
215
215
}
216
216
217
- /// Define a safe function that is const as long as `const-extern-fn` is enabled.
217
+ /// Define a safe function that is not const for `ctest`
218
218
macro_rules! safe_f {
219
219
( $(
220
220
$( #[ $attr: meta] ) *
@@ -223,12 +223,12 @@ cfg_if! {
223
223
) * ) => ( $(
224
224
#[ inline]
225
225
$( #[ $attr] ) *
226
- pub $ ( $constness ) * extern fn $i( $( $arg: $argty) , * ) -> $ret
226
+ pub extern fn $i( $( $arg: $argty) , * ) -> $ret
227
227
$body
228
228
) * )
229
229
}
230
230
231
- /// A nonpublic function that is const as long as `const-extern-fn` is enabled.
231
+ /// A nonpublic function that is not const for `ctest`
232
232
macro_rules! const_fn {
233
233
( $(
234
234
$( #[ $attr: meta] ) *
@@ -237,12 +237,12 @@ cfg_if! {
237
237
) * ) => ( $(
238
238
#[ inline]
239
239
$( #[ $attr] ) *
240
- $ ( $constness ) * fn $i( $( $arg: $argty) , * ) -> $ret
240
+ fn $i( $( $arg: $argty) , * ) -> $ret
241
241
$body
242
242
) * )
243
243
}
244
244
} else {
245
- /// Define an `unsafe` function that is const as long as `const-extern-fn` is enabled.
245
+ /// Define an `unsafe` function that is const as long as we are not running `ctest`
246
246
macro_rules! f {
247
247
( $(
248
248
$( #[ $attr: meta] ) *
@@ -251,12 +251,12 @@ cfg_if! {
251
251
) * ) => ( $(
252
252
#[ inline]
253
253
$( #[ $attr] ) *
254
- pub unsafe extern fn $i( $( $arg: $argty) , * ) -> $ret
254
+ pub $ ( $constness ) * unsafe extern fn $i( $( $arg: $argty) , * ) -> $ret
255
255
$body
256
256
) * )
257
257
}
258
258
259
- /// Define a safe function that is const as long as `const-extern-fn` is enabled.
259
+ /// Define a safe function that is const as long as we are not running `ctest`
260
260
macro_rules! safe_f {
261
261
( $(
262
262
$( #[ $attr: meta] ) *
@@ -265,12 +265,12 @@ cfg_if! {
265
265
) * ) => ( $(
266
266
#[ inline]
267
267
$( #[ $attr] ) *
268
- pub extern fn $i( $( $arg: $argty) , * ) -> $ret
268
+ pub $ ( $constness ) * extern fn $i( $( $arg: $argty) , * ) -> $ret
269
269
$body
270
270
) * )
271
271
}
272
272
273
- /// A nonpublic function that is const as long as `const-extern-fn` is enabled.
273
+ /// A nonpublic function that is const as long as we are not running `ctest`
274
274
macro_rules! const_fn {
275
275
( $(
276
276
$( #[ $attr: meta] ) *
@@ -279,7 +279,7 @@ cfg_if! {
279
279
) * ) => ( $(
280
280
#[ inline]
281
281
$( #[ $attr] ) *
282
- fn $i( $( $arg: $argty) , * ) -> $ret
282
+ $ ( $constness ) * fn $i( $( $arg: $argty) , * ) -> $ret
283
283
$body
284
284
) * )
285
285
}
0 commit comments