[RFC,10/34] stdio-common: Fix building when !IS_IN (libc)

Message ID 20230319151017.531737-11-bugaevc@gmail.com
State Committed, archived
Headers
Series The rest of the x86_64-gnu port |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Sergey Bugaev March 19, 2023, 3:09 p.m. UTC
  In this case, _itoa_word () is already defined inline in the header (see
sysdeps/generic/_itoa.h), and the second definition causes an error.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
 stdio-common/_itoa.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Samuel Thibault April 2, 2023, 11:01 p.m. UTC | #1
Applied, thanks!

Sergey Bugaev, le dim. 19 mars 2023 18:09:53 +0300, a ecrit:
> In this case, _itoa_word () is already defined inline in the header (see
> sysdeps/generic/_itoa.h), and the second definition causes an error.
> 
> Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
> ---
>  stdio-common/_itoa.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c
> index 27285193..3037b0f5 100644
> --- a/stdio-common/_itoa.c
> +++ b/stdio-common/_itoa.c
> @@ -157,6 +157,7 @@ const struct base_table_t _itoa_base_table[] attribute_hidden =
>  };
>  #endif
>  
> +#if IS_IN (libc)
>  char *
>  _itoa_word (_ITOA_WORD_TYPE value, char *buflim,
>  	    unsigned int base, int upper_case)
> @@ -185,6 +186,7 @@ _itoa_word (_ITOA_WORD_TYPE value, char *buflim,
>    return buflim;
>  }
>  #undef SPECIAL
> +#endif /* IS_IN (libc) */
>  
>  
>  #if _ITOA_NEEDED
> -- 
> 2.39.2
>
  

Patch

diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c
index 27285193..3037b0f5 100644
--- a/stdio-common/_itoa.c
+++ b/stdio-common/_itoa.c
@@ -157,6 +157,7 @@  const struct base_table_t _itoa_base_table[] attribute_hidden =
 };
 #endif
 
+#if IS_IN (libc)
 char *
 _itoa_word (_ITOA_WORD_TYPE value, char *buflim,
 	    unsigned int base, int upper_case)
@@ -185,6 +186,7 @@  _itoa_word (_ITOA_WORD_TYPE value, char *buflim,
   return buflim;
 }
 #undef SPECIAL
+#endif /* IS_IN (libc) */
 
 
 #if _ITOA_NEEDED