From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2507 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] include/stdio.h: declare *asprintf with _BSD_SOURCE Date: Fri, 28 Dec 2012 15:40:22 -0500 Message-ID: <20121228204021.GE20323@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1356727237 9786 80.91.229.3 (28 Dec 2012 20:40:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Dec 2012 20:40:37 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2508-gllmg-musl=m.gmane.org@lists.openwall.com Fri Dec 28 21:40:53 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Togjb-0001Wl-A1 for gllmg-musl@plane.gmane.org; Fri, 28 Dec 2012 21:40:51 +0100 Original-Received: (qmail 7411 invoked by uid 550); 28 Dec 2012 20:40:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7400 invoked from network); 28 Dec 2012 20:40:35 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2507 Archived-At: 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 > 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