diff --git a/libs/libc/stdio/Kconfig b/libs/libc/stdio/Kconfig index bcec3917cb..3e787562d8 100644 --- a/libs/libc/stdio/Kconfig +++ b/libs/libc/stdio/Kconfig @@ -80,6 +80,9 @@ config LIBC_LONG_LONG libraries that will be drawn into the build if long long support is enabled. + NOTE: This setting has no effect if the underlying architecture + cannot support long long types + config LIBC_NUMBERED_ARGS bool "Enable numbered arguments in printf" default n diff --git a/libs/libc/stdio/lib_libvscanf.c b/libs/libc/stdio/lib_libvscanf.c index e9ca092b34..df805bcd18 100644 --- a/libs/libc/stdio/lib_libvscanf.c +++ b/libs/libc/stdio/lib_libvscanf.c @@ -1,8 +1,8 @@ /**************************************************************************** * libs/libc/stdio/lib_libsscanf.c * - * Copyright (C) 2007, 2008, 2011-2014, 2016, 2019 Gregory Nutt. All rights - * reserved. + * Copyright (C) 2007, 2008, 2011-2014, 2016, 2019 Gregory Nutt. All + * rights reserved. * Author: Gregory Nutt * Johannes Schock * @@ -52,6 +52,7 @@ #include #include +#include #include #include "libc.h" @@ -60,6 +61,14 @@ * Pre-processor Definitions ****************************************************************************/ +/* CONFIG_LIBC_LONG_LONG is not a valid selection of the compiler does not + * support long long types. + */ + +#ifndef CONFIG_HAVE_LONG_LONG +# undef CONFIG_LIBC_LONG_LONG +#endif + #define MAXLN 128 #define HH_MOD -2 diff --git a/libs/libc/stdio/lib_ultoa_invert.h b/libs/libc/stdio/lib_ultoa_invert.h index c7e89bdb8a..7f7d3fb86a 100644 --- a/libs/libc/stdio/lib_ultoa_invert.h +++ b/libs/libc/stdio/lib_ultoa_invert.h @@ -48,6 +48,14 @@ * Pre-processor Definitions ****************************************************************************/ +/* CONFIG_LIBC_LONG_LONG is not a valid selection of the compiler does not + * support long long types. + */ + +#ifndef CONFIG_HAVE_LONG_LONG +# undef CONFIG_LIBC_LONG_LONG +#endif + /* Next flags are to use with `base'. Unused fields are reserved. */ #define XTOA_PREFIX 0x0100 /* Put prefix for octal or hex */