Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 8 Feb 2013 18:07:41 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: musl detection by preprocessor

* Jens Gustedt <jens.gustedt@...ia.fr> [2013-02-08 17:51:41 +0100]:

> Am Freitag, den 08.02.2013, 17:41 +0100 schrieb Szabolcs Nagy:
> > * Jens Gustedt <jens.gustedt@...ia.fr> [2013-02-08 17:28:07 +0100]:
> > > In short I have some problem where they (the gnus) deviate from
> > > standard interfaces, here this was triggered by their different
> > > iterface for strerror_r. Now the musl compiler wrapper doesn't allow
> > > to distinguish a linux system with glibc or with musl (or at least I
> > > didn'find one).
> > > 
> > > Inspecting the wrapper, it looks quite easy to add something like
> > > 
> > > -D__MUSL__=000909UL
> > > 
> > 
> > can you use #ifdef __GLIBC__ ?
> 
> Hm, I don't think that this comes timely enough. Where would this be
> defined, probably in some header file that I'd include, no?
> 
> I'd like to distinguish the platform as early as possible, ideally
> *before* I include any files, such that I can base decisions on which
> files to include only on #defines that the pure compiler provides.
> 

ok now i understand what you want

i think you should use featuretest macros
to get a subset of the interfaces
(eg specify -D_BSD_SOURCE for all bsd things
or -D_POSIX_C_SOURCE=200809L for posix etc)

you can check the default setting in
include/features.h

strerror_r may be bad to provide under _GNU_SOURCE
but by that logic we should not provide ptrintf
under _GNU_SOURCE either as the gnu printf is
non-conformant but musl's printf is

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.