87
87
88
88
#endif /* VIA_TWISTER */
89
89
90
+ /* Can't use IS_ENABLED on symbols that don't start with CONFIG_
91
+ * without checkpatch complaints, so do something else.
92
+ */
93
+ #if USE_LIBC
94
+ #define ENABLED_USE_LIBC true
95
+ #else
96
+ #define ENABLED_USE_LIBC false
97
+ #endif
98
+
90
99
#include "../../../lib/os/cbprintf.c"
91
100
92
101
#if defined(CONFIG_CBPRINTF_COMPLETE )
@@ -297,7 +306,7 @@ static void test_c(void)
297
306
}
298
307
299
308
rc = TEST_PRF ("%lc" , (wint_t )'a' );
300
- if (IS_ENABLED ( USE_LIBC ) ) {
309
+ if (ENABLED_USE_LIBC ) {
301
310
PRF_CHECK ("a" , rc );
302
311
} else {
303
312
PRF_CHECK ("%lc" , rc );
@@ -345,7 +354,7 @@ static void test_s(void)
345
354
PRF_CHECK ("/123/12//" , rc );
346
355
347
356
rc = TEST_PRF ("%ls" , ws );
348
- if (IS_ENABLED ( USE_LIBC ) ) {
357
+ if (ENABLED_USE_LIBC ) {
349
358
PRF_CHECK ("abc" , rc );
350
359
} else {
351
360
PRF_CHECK ("%ls" , rc );
@@ -361,7 +370,7 @@ static void test_v_c(void)
361
370
rc = rawprf ("%c" , 'a' );
362
371
zassert_equal (rc , 1 , NULL );
363
372
zassert_equal (buf [0 ], 'a' , NULL );
364
- if (!IS_ENABLED ( USE_LIBC ) ) {
373
+ if (!ENABLED_USE_LIBC ) {
365
374
zassert_equal (buf [1 ], 'b' , "wth %x" , buf [1 ]);
366
375
}
367
376
}
@@ -830,7 +839,7 @@ static void test_fp_length(void)
830
839
}
831
840
832
841
rc = TEST_PRF ("/%Lg/" , (long double )dv );
833
- if (IS_ENABLED ( USE_LIBC ) ) {
842
+ if (ENABLED_USE_LIBC ) {
834
843
PRF_CHECK ("/1.2345/" , rc );
835
844
} else {
836
845
PRF_CHECK ("/%Lg/" , rc );
@@ -1007,7 +1016,7 @@ static void test_arglen(void)
1007
1016
1008
1017
static void test_p (void )
1009
1018
{
1010
- if (IS_ENABLED ( USE_LIBC ) ) {
1019
+ if (ENABLED_USE_LIBC ) {
1011
1020
TC_PRINT ("skipping on libc\n" );
1012
1021
return ;
1013
1022
}
@@ -1124,7 +1133,7 @@ void test_main(void)
1124
1133
}
1125
1134
1126
1135
TC_PRINT ("Opts: " COND_CODE_1 (M64_MODE , ("m64" ), ("m32" )) "\n" );
1127
- if (IS_ENABLED ( USE_LIBC ) ) {
1136
+ if (ENABLED_USE_LIBC ) {
1128
1137
TC_PRINT (" LIBC" );
1129
1138
}
1130
1139
if (IS_ENABLED (CONFIG_CBPRINTF_COMPLETE )) {
0 commit comments