about summary refs log tree commit diff
path: root/libio/iofopncook.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-10-18 17:00:07 +0200
committerFlorian Weimer <fweimer@redhat.com>2022-10-18 17:04:10 +0200
commit58548b9d689fb9bba67bdc5b59c8d2fa47f4f8ec (patch)
tree0aea307f4cf761952fbdf15fd67fc3b09b43707c /libio/iofopncook.c
parent88f4b6929c26f9240a4b0b7dcc62922f02544a09 (diff)
downloadglibc-58548b9d689fb9bba67bdc5b59c8d2fa47f4f8ec.tar.gz
glibc-58548b9d689fb9bba67bdc5b59c8d2fa47f4f8ec.tar.xz
glibc-58548b9d689fb9bba67bdc5b59c8d2fa47f4f8ec.zip
Use PTR_MANGLE and PTR_DEMANGLE unconditionally in C sources
In the future, this will result in a compilation failure if the
macros are unexpectedly undefined (due to header inclusion ordering
or header inclusion missing altogether).

Assembler sources are more difficult to convert.  In many cases,
they are hand-optimized for the mangling and no-mangling variants,
which is why they are not converted.

sysdeps/s390/s390-32/__longjmp.c and sysdeps/s390/s390-64/__longjmp.c
are special: These are C sources, but most of the implementation is
in assembler, so the PTR_DEMANGLE macro has to be undefined in some
cases, to match the assembler style.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'libio/iofopncook.c')
-rw-r--r--libio/iofopncook.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/libio/iofopncook.c b/libio/iofopncook.c
index a7db4ef1c9..6c27610319 100644
--- a/libio/iofopncook.c
+++ b/libio/iofopncook.c
@@ -35,9 +35,7 @@ _IO_cookie_read (FILE *fp, void *buf, ssize_t size)
 {
   struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
   cookie_read_function_t *read_cb = cfile->__io_functions.read;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (read_cb);
-#endif
 
   if (read_cb == NULL)
     return -1;
@@ -50,9 +48,7 @@ _IO_cookie_write (FILE *fp, const void *buf, ssize_t size)
 {
   struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
   cookie_write_function_t *write_cb = cfile->__io_functions.write;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (write_cb);
-#endif
 
   if (write_cb == NULL)
     {
@@ -72,9 +68,7 @@ _IO_cookie_seek (FILE *fp, off64_t offset, int dir)
 {
   struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
   cookie_seek_function_t *seek_cb = cfile->__io_functions.seek;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (seek_cb);
-#endif
 
   return ((seek_cb == NULL
 	   || (seek_cb (cfile->__cookie, &offset, dir)
@@ -88,9 +82,7 @@ _IO_cookie_close (FILE *fp)
 {
   struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
   cookie_close_function_t *close_cb = cfile->__io_functions.close;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (close_cb);
-#endif
 
   if (close_cb == NULL)
     return 0;
@@ -139,12 +131,10 @@ static void
 set_callbacks (cookie_io_functions_t *target,
 	       cookie_io_functions_t source)
 {
-#ifdef PTR_MANGLE
   PTR_MANGLE (source.read);
   PTR_MANGLE (source.write);
   PTR_MANGLE (source.seek);
   PTR_MANGLE (source.close);
-#endif
   *target = source;
 }
 
@@ -226,9 +216,7 @@ _IO_old_cookie_seek (FILE *fp, off64_t offset, int dir)
   struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
   int (*seek_cb) (FILE *, off_t, int)
     = (int (*) (FILE *, off_t, int)) cfile->__io_functions.seek;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (seek_cb);
-#endif
 
   if (seek_cb == NULL)
     return _IO_pos_BAD;