From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18520 invoked from network); 16 Apr 2022 08:14:14 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 16 Apr 2022 08:14:14 -0000 Received: (qmail 30269 invoked by uid 550); 16 Apr 2022 08:14:10 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 30232 invoked from network); 16 Apr 2022 08:14:09 -0000 Message-ID: <87a84620-df28-7e62-23e4-57e52bd068af@ludocode.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ludocode.com; s=key1; t=1650096838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gH1r2iyINQh2LtSARP8EyxlMkvjmenhiVSjGBqIz7ds=; b=PvT+HHwM1WJdcPSbtae4aNNa+x1SYeBVlzh3LP8Aq+BwojwTaM+7DBzB/F8dM7rp5gAvmM lQIcXhiSL07RseaicPYzXjukCAckyQ6qtpwRKhK7oor3PPZAO/QLBeaq/CbJql4KlVNJKM +6wxI7PhJTL6GJ0YvsAcfUr0DV0YoZV1YWbPs+6jYIiv2qs5VJg9Lcx9+SMGpLZMeISR8s uA9DTeR5L3/MxMbfyV/c2RskRS7kKBFUAhvb4W36Sz9e+NG1NZjH/UWUrlNCptxhIiaeVA gl9ycIooSSCpPYOtCcY4RNnCj6s58IN4SLX2L06sHY3euqN6xZzp+b99+NhfRQ== Date: Sat, 16 Apr 2022 04:13:56 -0400 MIME-Version: 1.0 Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Nicholas Fraser To: musl@lists.openwall.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: ludocode.com Subject: [musl] Detect qsort_r() support with preprocessor 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. 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? I am writing a cross-platform header-only library. I want my users to be able to just drop the header files of my library into their codebase. I really don't want them to have to write their own configure tests just to tell my library whether musl provides qsort_r(). I am able to detect variants of qsort_r() or qsort_s() with the preprocessor on all other platforms that support such an extension. Is there a way to detect it with musl? Nick