Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions makefiles/pseudomodules.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,20 @@ PSEUDOMODULES += picolibc
PSEUDOMODULES += picolibc_stdout_buffered
PSEUDOMODULES += pktqueue
PSEUDOMODULES += posix_headers
## @defgroup sys_stdio_printf_float Support for printing floats
## @ingroup sys_stdio
## @{
## This module enables printing of floats, if the printf implementation has
## configurable features.
PSEUDOMODULES += printf_float
## @}
## @defgroup sys_stdio_printf_long_long Support for printing long long
## @ingroup sys_stdio
## @{
## This module enables printing of long long / unsigned long long, if the printf
## implementation has configurable features.
PSEUDOMODULES += printf_long_long
## @}
PSEUDOMODULES += prng
PSEUDOMODULES += prng_%
PSEUDOMODULES += psa_riot_cipher_aes_common
Expand Down
6 changes: 6 additions & 0 deletions pkg/mpaland-printf/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
# AVR MCUs we do need the ability to print from PROGMEM, though. Hence, this
# is not compatible with AVR MCUs.
FEATURES_BLACKLIST += arch_avr8

# On 32 bit and 64 bit systems support for long long is so cheap, that we
# can enable it by default. Users can still disable it, though.
ifneq (,$(filter arch_32bit arch_64bit,$(FEATURES_USED)))
DEFAULT_MODULE += printf_long_long
endif

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 4d6939143a251b93022980a472f2bcd9c42b8573 Mon Sep 17 00:00:00 2001
From: Marian Buschsieweke <[email protected]>
Date: Sat, 11 May 2024 18:38:51 +0200
Subject: [PATCH 3/4] RIOT integration: Select features based on modules

Using module `printf_float` adds support for printing floats, using
module `printf_long_long` adds support for printing `long long` or
`unsigned long long`.
---
printf.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/printf.c b/printf.c
index d560d2b..6923fee 100644
--- a/printf.c
+++ b/printf.c
@@ -60,8 +60,8 @@
#endif

// support for the floating point type (%f)
-// default: activated
-#ifndef PRINTF_DISABLE_SUPPORT_FLOAT
+// default: deactivated
+#ifdef MODULE_PRINTF_FLOAT
#define PRINTF_SUPPORT_FLOAT
#endif

@@ -84,8 +84,8 @@
#endif

// support for the long long types (%llu or %p)
-// default: activated
-#ifndef PRINTF_DISABLE_SUPPORT_LONG_LONG
+// default: deactivated
+#ifdef MODULE_PRINTF_LONG_LONG
#define PRINTF_SUPPORT_LONG_LONG
#endif

--
2.49.0