From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3398 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: apr and time.h Date: Thu, 6 Jun 2013 22:38:37 +0200 Message-ID: <20130606203837.GD15710@port70.net> 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 1370551130 11037 80.91.229.3 (6 Jun 2013 20:38:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Jun 2013 20:38:50 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3402-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jun 06 22:38:50 2013 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 1UkgxN-0004ek-Or for gllmg-musl@plane.gmane.org; Thu, 06 Jun 2013 22:38:49 +0200 Original-Received: (qmail 7613 invoked by uid 550); 6 Jun 2013 20:38:49 -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 7605 invoked from network); 6 Jun 2013 20:38:49 -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:3398 Archived-At: * Jens [2013-06-06 19:42:39 +0200]: > apr wont build (for me) with the following part of time.h (musl-0.9.10): > > #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) > #define tm_gmtoff __tm_gmtoff > #define tm_zone __tm_zone > #endif > > apr implements a struct with a member named tm_gmtoff. > you gotta love "portability runtime" libraries.. tm_ is in the reserved namespace of posix, but time.h is specified by iso c as well which does not have such restriction so in this case they are not strictly wrong the correct behaviour of musl would be to only expose iso c interfaces by default but then all the codes in the world break.. (including apr most likely) an ugly workaround that does less namespace pollution (no tm_* macro): #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) #define __tm_gmtoff tm_gmtoff #define __tm_zone tm_zone #define _FIX(x) x #else #define _FIX(x) __##x #endif struct tm { /*...*/ long _FIX(tm_gmtoff); const char *_FIX(tm_zone); }; either this or fix apr so it does not collide with the posix namespace..