From: Quentin Rameau <quinq@fifth.space>
To: musl@lists.openwall.com
Subject: Re: [musl] Detect qsort_r() support with preprocessor
Date: Sat, 16 Apr 2022 16:16:26 +0200 [thread overview]
Message-ID: <20220416161626.55aadace.quinq@fifth.space> (raw)
In-Reply-To: <20220416120154.GA2553@voyager>
Hi,
> > Hello musl devs,
> >
> > qsort_r() has been added to musl 1.2.3 and it has been backported to
> > the previous version of musl in Alpine. How can I detect whether this
> > function is available using the preprocessor?
> >
> > The community wiki advocates "testing" for feature support, which I
> > guess means compiling a test program like an autotools configure
> > script.
>
> Guess why that is. It is more portable to do that way than to define new
> non-standard macros. The only macros musl will define are standard ones.
>
> > Can we not just test for a macro instead? Have you considered
> > defining something like `__HAS_QSORT_R` to tell us directly that you
> > support it?
> >
>
> Unless qsort_r() were part of a new release of POSIX (then you could
> look at _POSIX_VERSION), or a member of an option group (then you could
> look at the option group macro), not really.
Just as a note, qsort_r() has indeed been added to POSIX-next, so you'd
only need to ask for _POSIX_C_SOURCE with a value of 20XXXX, when it's
actually been released.
next prev parent reply other threads:[~2022-04-16 14:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-16 8:13 Nicholas Fraser
2022-04-16 12:01 ` Markus Wichmann
2022-04-16 14:16 ` Quentin Rameau [this message]
2022-04-16 17:50 ` Nicholas Fraser
2022-04-16 18:42 ` Quentin Rameau
2022-04-16 23:59 ` Nicholas Fraser
2022-04-17 2:04 ` Rich Felker
2022-04-19 3:38 ` Nicholas Fraser
2022-04-19 6:59 ` Markus Wichmann
2022-04-19 23:10 ` Nicholas Fraser
2022-04-19 13:32 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220416161626.55aadace.quinq@fifth.space \
--to=quinq@fifth.space \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).