Skip to content

Commit 80f397a

Browse files
committed
Switch _PRINTF_PERCENT_N_ to __IO_PERCENT_N
Match other printf/scanf options. Signed-off-by: Keith Packard <[email protected]>
1 parent ac9825e commit 80f397a

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ if(NOT DEFINED _PRINTF_SMALL_ULTOA)
223223
option(_PRINTF_SMALL_ULTOA "Avoid soft divide in printf" ON)
224224
endif()
225225

226-
if(NOT DEFINED _PRINTF_PERCENT_N)
227-
option(_PRINTF_PERCENT_N "Support %n formats in printf" OFF)
226+
if(NOT DEFINED __IO_PERCENT_N)
227+
option(__IO_PERCENT_N "Support %n formats in printf" OFF)
228228
endif()
229229

230230
if(NOT DEFINED __IO_PERCENT_B)

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ if tinystdio
14111411
conf_data.set('_PRINTF_SMALL_ULTOA',
14121412
printf_small_ultoa,
14131413
description: 'avoid software division in decimal conversion')
1414-
conf_data.set('_PRINTF_PERCENT_N',
1414+
conf_data.set('__IO_PERCENT_N',
14151415
printf_percent_n,
14161416
description: 'support %n in printf format strings')
14171417
conf_data.set('__ATOMIC_UNGETC',

newlib/libc/tinystdio/vfprintf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ int vfprintf (FILE * stream, const CHAR *fmt, va_list ap_orig)
11621162
#endif
11631163
}
11641164
#endif
1165-
#if defined(_PRINTF_PERCENT_N) || defined(VFPRINTF_S)
1165+
#if defined(__IO_PERCENT_N) || defined(VFPRINTF_S)
11661166
} else if (c == 'n') {
11671167
#ifdef VFPRINTF_S
11681168
msg = "format string contains percent-n";

picolibc.h.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979

8080
#cmakedefine _PRINTF_SMALL_ULTOA
8181

82-
#cmakedefine _PRINTF_PERCENT_N
82+
#cmakedefine __IO_PERCENT_N
8383

8484
#cmakedefine __IO_PERCENT_B
8585

test/libc-testsuite/snprintf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static int test_snprintf(void)
199199
#endif
200200
#endif
201201

202-
#if !defined(__TINY_STDIO) || defined(_PRINTF_PERCENT_N)
202+
#if !defined(__TINY_STDIO) || defined(__IO_PERCENT_N)
203203
/* Tests for %hhn, %hn, %n, %ln, %lln */
204204
int len;
205205
short slen;

test/test-sprintf-percent-n.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
int main(void) {
4343

44-
#if defined(__PICOLIBC__) && defined(__TINY_STDIO) && !defined(_PRINTF_PERCENT_N)
44+
#if defined(__PICOLIBC__) && defined(__TINY_STDIO) && !defined(__IO_PERCENT_N)
4545
printf("printf: %%n unsupported\n");
4646
return 77;
4747
#else

0 commit comments

Comments
 (0)