]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
<stdio.h>: Make fopencookie, vasprintf, asprintf available by default
authorFlorian Weimer <fweimer@redhat.com>
Thu, 6 Apr 2023 14:40:44 +0000 (16:40 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 6 Apr 2023 14:41:15 +0000 (16:41 +0200)
FreeBSD makes these functions available by default, so we should
not treat them as GNU-specific and restrict them to _GNU_SOURCE.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
libio/stdio.h

index 686c40f28dc6de7724205600fe2bff83d4278eee..45ddafdf20558c2bd3b61a6f264c928905b640b9 100644 (file)
@@ -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
 
@@ -299,7 +299,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,
@@ -389,7 +389,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,