Skip to content

Commit

Permalink
[ext] Update eyalroz/printf to v6.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Nov 3, 2024
1 parent 31f8141 commit fa7b293
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
11 changes: 7 additions & 4 deletions ext/eyalroz/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ def prepare(module, options):
return True

def build(env):
is_hosted = env[":target"].identifier.platform == "hosted"
with_long_long = env.get(":io:with_long_long",
"avr" not in env[":target"].identifier.platform)

env.collect(":build:path.include", "modm/ext")
env.outbasepath = "modm/ext/printf"

env.copy("printf/src/printf/printf.h", "printf.h")
files = env.copy("printf/src/printf/printf.c", "printf.c")
env.collect(":build:ccflags", "-Wno-double-promotion", "-Wno-overflow", operations=files)
env.collect(":build:ccflags", "-Wno-overflow", operations=files)

with_long_long = "avr" not in env[":target"].identifier.platform
env.substitutions = {
"with_long_long": env.get(":io:with_long_long", with_long_long),
"is_hosted": env[":target"].identifier.platform == "hosted",
"with_long_long": with_long_long,
"is_hosted": is_hosted,
}
env.template("printf_config.h.in")
2 changes: 1 addition & 1 deletion ext/eyalroz/printf
10 changes: 2 additions & 8 deletions ext/eyalroz/printf_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,13 @@
#endif

#ifndef PRINTF_DEFAULT_FLOAT_PRECISION
#define PRINTF_DEFAULT_FLOAT_PRECISION 5
#endif

#ifndef PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
#define PRINTF_ALIAS_STANDARD_FUNCTION_NAMES {{ 0 if is_hosted else 1 }}
#define PRINTF_DEFAULT_FLOAT_PRECISION 5
#endif

#ifndef PRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD
#define PRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD 0
#define PRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD {{ 0 if is_hosted else 1 }}
#endif

#ifndef PRINTF_ALIAS_STANDARD_FUNCTION_NAMES_SOFT
#define PRINTF_ALIAS_STANDARD_FUNCTION_NAMES_SOFT 0
#endif


0 comments on commit fa7b293

Please sign in to comment.