From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1714 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: compatability: bits/syscall.h requires C99 Date: Fri, 24 Aug 2012 09:53:16 +0200 Message-ID: <20120824075315.GF10731@port70.net> References: <12609.132.241.65.179.1345698455.squirrel@lavabit.com> <503622B4.8020506@barfooze.de> <20120823123453.GO27715@brightrain.aerifal.cx> <20120823172519.39f899b6@newbook> <20120824020749.GU27715@brightrain.aerifal.cx> <20120824023425.GV27715@brightrain.aerifal.cx> 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 1345794814 5040 80.91.229.3 (24 Aug 2012 07:53:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Aug 2012 07:53:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1715-gllmg-musl=m.gmane.org@lists.openwall.com Fri Aug 24 09:53:35 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 1T4ohu-0000ME-4U for gllmg-musl@plane.gmane.org; Fri, 24 Aug 2012 09:53:30 +0200 Original-Received: (qmail 3787 invoked by uid 550); 24 Aug 2012 07:53:28 -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 3779 invoked from network); 24 Aug 2012 07:53:28 -0000 Content-Disposition: inline In-Reply-To: <20120824023425.GV27715@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1714 Archived-At: * Rich Felker [2012-08-23 22:34:25 -0400]: > OK, after discussion on IRC, the 2 options under consideration are: > > #if __STDC_VERSION__ < 199901L && defined(__GNUC__) > #define inline __inline > #define restrict __restrict > #elif __STDC_VERSION__ < 199901L > #define inline > #define restrict > #endif > > and > > #if __STDC_VERSION__ >= 199901L > #define __inline inline > #define __restrict restrict > #endif > > added near the top of headers that need to use inline and/or restrict. this won't work with c++, nor old strict c compilers without __inline and __restrict and can break various c parsing tools (ctags, swig, various lints, ..) i'd use #ifdef __cplusplus #define __inline inline #define __restrict #elif __STDC_VERSION__ >= 199901L #define __inline inline #define __restrict restrict #elif !defined(__GNUC__) #define __inline #define __restrict #endif so any standard c99 compiler will get the inline/restrict (tcc, pcc, gcc -std=c99, clang -std=c99) and any gnu c compiler will get __inline/__restrict (gcc, clang) but other tools won't see anything