[v2] <stdio.h>: Make fopencookie, vasprintf, asprintf available by default

Message ID 87fse82w0d.fsf@oldenburg.str.redhat.com
State New
Headers
Series [v2] <stdio.h>: Make fopencookie, vasprintf, asprintf available by default |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Florian Weimer Nov. 24, 2022, 3:49 p.m. UTC
  FreeBSD makes these functions available by default, so we should
not treat them as GNU-specific and restrict them to _GNU_SOURCE.

---
v2: Do not include fcloseall because it's broken.

 libio/stdio.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


base-commit: 5bb4b51a76cc9bec72f67f702b5bf2fce30f0f7c
  

Patch

diff --git a/libio/stdio.h b/libio/stdio.h
index 0e0f16b464..10af6d9b60 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -42,7 +42,7 @@  __BEGIN_DECLS
 #include <bits/types/FILE.h>
 #include <bits/types/struct_FILE.h>
 
-#ifdef __USE_GNU
+#ifdef __USE_MISC
 # include <bits/types/cookie_io_functions_t.h>
 #endif
 
@@ -294,7 +294,7 @@  extern FILE *fdopen (int __fd, const char *__modes) __THROW
   __attribute_malloc__ __attr_dealloc_fclose __wur;
 #endif
 
-#ifdef	__USE_GNU
+#ifdef	__USE_MISC
 /* Create a new stream that refers to the given magic cookie,
    and uses the given functions for input and output.  */
 extern FILE *fopencookie (void *__restrict __magic_cookie,
@@ -384,7 +384,7 @@  extern int vsnprintf (char *__restrict __s, size_t __maxlen,
      __THROWNL __attribute__ ((__format__ (__printf__, 3, 0)));
 #endif
 
-#if __GLIBC_USE (LIB_EXT2)
+#if defined (__USE_MISC) || __GLIBC_USE (LIB_EXT2)
 /* Write formatted output to a string dynamically allocated with `malloc'.
    Store the address of the string in *PTR.  */
 extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,