* [PATCH] include/stdio.h: declare *asprintf with _BSD_SOURCE
@ 2012-12-28 14:23 Strake
2012-12-28 20:40 ` Rich Felker
0 siblings, 1 reply; 3+ messages in thread
From: Strake @ 2012-12-28 14:23 UTC (permalink / raw)
To: musl
*asprintf is indeed declared in BSD stdio.h, so do the same in musl.
commit 389e354a13ee040a9a413e61639be6d68ff1bc03
Author: strake <strake888@gmail.com>
Date: Fri Dec 28 09:20:13 2012 -0500
include/stdio.h: declare *asprintf with _BSD_SOURCE
diff --git a/include/stdio.h b/include/stdio.h
index 6e8e645..79b2c0f 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -177,9 +177,12 @@ int putw(int, FILE *);
char *fgetln(FILE *, size_t *);
#endif
-#ifdef _GNU_SOURCE
+#if defined _GNU_SOURCE || defined _BSD_SOURCE
int asprintf(char **, const char *, ...);
int vasprintf(char **, const char *, va_list);
+#endif
+
+#ifdef _GNU_SOURCE
char *fgets_unlocked(char *, int, FILE *);
int fputs_unlocked(const char *, FILE *);
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] include/stdio.h: declare *asprintf with _BSD_SOURCE
2012-12-28 14:23 [PATCH] include/stdio.h: declare *asprintf with _BSD_SOURCE Strake
@ 2012-12-28 20:40 ` Rich Felker
2012-12-28 23:32 ` Strake
0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2012-12-28 20:40 UTC (permalink / raw)
To: musl
On Fri, Dec 28, 2012 at 09:23:17AM -0500, Strake wrote:
> *asprintf is indeed declared in BSD stdio.h, so do the same in musl.
This change should be fine.
> commit 389e354a13ee040a9a413e61639be6d68ff1bc03
> Author: strake <strake888@gmail.com>
> Date: Fri Dec 28 09:20:13 2012 -0500
>
> include/stdio.h: declare *asprintf with _BSD_SOURCE
>
> diff --git a/include/stdio.h b/include/stdio.h
> index 6e8e645..79b2c0f 100644
> --- a/include/stdio.h
> +++ b/include/stdio.h
> @@ -177,9 +177,12 @@ int putw(int, FILE *);
> char *fgetln(FILE *, size_t *);
> #endif
>
> -#ifdef _GNU_SOURCE
> +#if defined _GNU_SOURCE || defined _BSD_SOURCE
> int asprintf(char **, const char *, ...);
> int vasprintf(char **, const char *, va_list);
> +#endif
> +
> +#ifdef _GNU_SOURCE
There's already an #if block just above that's GNU-or-BSD. I'm just
moving these two declarations into it rather than making a new one.
Rich
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] include/stdio.h: declare *asprintf with _BSD_SOURCE
2012-12-28 20:40 ` Rich Felker
@ 2012-12-28 23:32 ` Strake
0 siblings, 0 replies; 3+ messages in thread
From: Strake @ 2012-12-28 23:32 UTC (permalink / raw)
To: musl
On 28/12/2012, Rich Felker <dalias@aerifal.cx> wrote:
> On Fri, Dec 28, 2012 at 09:23:17AM -0500, Strake wrote:
>> *asprintf is indeed declared in BSD stdio.h, so do the same in musl.
>
> This change should be fine.
>
>> commit 389e354a13ee040a9a413e61639be6d68ff1bc03
>> Author: strake <strake888@gmail.com>
>> Date: Fri Dec 28 09:20:13 2012 -0500
>>
>> include/stdio.h: declare *asprintf with _BSD_SOURCE
>>
>> diff --git a/include/stdio.h b/include/stdio.h
>> index 6e8e645..79b2c0f 100644
>> --- a/include/stdio.h
>> +++ b/include/stdio.h
>> @@ -177,9 +177,12 @@ int putw(int, FILE *);
>> char *fgetln(FILE *, size_t *);
>> #endif
>>
>> -#ifdef _GNU_SOURCE
>> +#if defined _GNU_SOURCE || defined _BSD_SOURCE
>> int asprintf(char **, const char *, ...);
>> int vasprintf(char **, const char *, va_list);
>> +#endif
>> +
>> +#ifdef _GNU_SOURCE
>
> There's already an #if block just above that's GNU-or-BSD. I'm just
> moving these two declarations into it rather than making a new one.
>
> Rich
>
Thanks.
Cheers,
Strake
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-12-28 23:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-28 14:23 [PATCH] include/stdio.h: declare *asprintf with _BSD_SOURCE Strake
2012-12-28 20:40 ` Rich Felker
2012-12-28 23:32 ` Strake
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).