[2/7] libio: Add hidden prototype for ungetc

Message ID 37770ae2fe48b56c9878e3dce96dd7a8d37b2360.1624961355.git.fweimer@redhat.com
State Committed
Commit 771473a8c4f44d11e8e6521a96f4e92c20984eb3
Delegated to: Adhemerval Zanella Netto
Headers
Series nss_files move |

Checks

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

Commit Message

Florian Weimer June 29, 2021, 10:11 a.m. UTC
  And make ungetc the primary symbol, with _IO_ungetc as an alias.
---
 include/stdio.h  | 1 +
 libio/ioungetc.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
  

Comments

Adhemerval Zanella Netto July 7, 2021, 1:33 p.m. UTC | #1
On 29/06/2021 07:11, Florian Weimer via Libc-alpha wrote:
> And make ungetc the primary symbol, with _IO_ungetc as an alias.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  include/stdio.h  | 1 +
>  libio/ioungetc.c | 6 +++---
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/include/stdio.h b/include/stdio.h
> index 2e0dc80c16..311adcf953 100644
> --- a/include/stdio.h
> +++ b/include/stdio.h
> @@ -212,6 +212,7 @@ libc_hidden_ldbl_proto (dprintf)
>  libc_hidden_ldbl_proto (fprintf)
>  libc_hidden_ldbl_proto (vfprintf)
>  libc_hidden_ldbl_proto (sprintf)
> +libc_hidden_proto (ungetc)
>  libc_hidden_proto (fwrite)
>  libc_hidden_proto (perror)
>  libc_hidden_proto (remove)
> diff --git a/libio/ioungetc.c b/libio/ioungetc.c
> index dcf1c4ca9e..e68a4aaca8 100644
> --- a/libio/ioungetc.c
> +++ b/libio/ioungetc.c
> @@ -27,7 +27,7 @@
>  #include "libioP.h"
>  
>  int
> -_IO_ungetc (int c, FILE *fp)
> +ungetc (int c, FILE *fp)
>  {
>    int result;
>    CHECK_FILE (fp, EOF);
> @@ -40,5 +40,5 @@ _IO_ungetc (int c, FILE *fp)
>    _IO_release_lock (fp);
>    return result;
>  }
> -
> -weak_alias (_IO_ungetc, ungetc)
> +libc_hidden_def (ungetc)
> +strong_alias (ungetc, _IO_ungetc)
>
  

Patch

diff --git a/include/stdio.h b/include/stdio.h
index 2e0dc80c16..311adcf953 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -212,6 +212,7 @@  libc_hidden_ldbl_proto (dprintf)
 libc_hidden_ldbl_proto (fprintf)
 libc_hidden_ldbl_proto (vfprintf)
 libc_hidden_ldbl_proto (sprintf)
+libc_hidden_proto (ungetc)
 libc_hidden_proto (fwrite)
 libc_hidden_proto (perror)
 libc_hidden_proto (remove)
diff --git a/libio/ioungetc.c b/libio/ioungetc.c
index dcf1c4ca9e..e68a4aaca8 100644
--- a/libio/ioungetc.c
+++ b/libio/ioungetc.c
@@ -27,7 +27,7 @@ 
 #include "libioP.h"
 
 int
-_IO_ungetc (int c, FILE *fp)
+ungetc (int c, FILE *fp)
 {
   int result;
   CHECK_FILE (fp, EOF);
@@ -40,5 +40,5 @@  _IO_ungetc (int c, FILE *fp)
   _IO_release_lock (fp);
   return result;
 }
-
-weak_alias (_IO_ungetc, ungetc)
+libc_hidden_def (ungetc)
+strong_alias (ungetc, _IO_ungetc)