From patchwork Fri Jul 5 15:44:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Haehnel X-Patchwork-Id: 1957401 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernkonzept.com header.i=@kernkonzept.com header.a=rsa-sha256 header.s=mx1 header.b=JTwZtoN8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WFyVy1GsZz1xqb for ; Sat, 6 Jul 2024 01:44:25 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id BC53C353639D; Fri, 5 Jul 2024 17:44:16 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernkonzept.com header.i=@kernkonzept.com header.a=rsa-sha256 header.s=mx1 header.b=JTwZtoN8; dkim-atps=neutral Received: from mx.kernkonzept.com (serv1.kernkonzept.com [159.69.200.6]) by helium.openadk.org (Postfix) with ESMTPS id CE6D3352826B for ; Fri, 5 Jul 2024 17:44:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kernkonzept.com; s=mx1; h=Content-Transfer-Encoding:MIME-Version:Message-ID :Date:Subject:Cc:To:From:References:In-Reply-To:Reply-To:Content-Type: Content-ID:Content-Description; bh=1Es2BeyJ4vzvErbtuSzivG+LqhtA7rPw+IYYzc9G5Ag=; b=JTwZtoN89vhfKn6MxtVe03EcRa geyfISECLogZoUgVnjdl13CCReJYW0yPhA++XdFKN4L0Xxjcmfo9j/4AeskQXMY5SY13KOiottUOI YolnKcgAWjQv2xEBTlXZbUDRTIJiFthCvRfa22Ub1AEWsarSI8/rfV2Sr6CjmDLYdqNK0sxsErcM9 K8whjHWmpyuNMK4ERgXIZ/msHOfL9l1ryZhbemdR3uZJeefv85G84TWtF0RnL2Q4YneWMWhR7OTO2 3A/KZ/aXTCv/9TmmGipH44jYWQ/9VMAmPhPTNpfh2Wb7V+21f2ReNJWj3BJOtMfLmusGuxxO+8BDx JtYOEBGw==; Received: from ipb21a422b.dynamic.kabel-deutschland.de ([178.26.66.43] helo=amethyst.dd1.int.kernkonzept.com) by mx.kernkonzept.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) id 1sPl6X-000IJc-1p; Fri, 05 Jul 2024 17:44:10 +0200 From: Marcus Haehnel To: devel@uclibc-ng.org Date: Fri, 5 Jul 2024 17:44:03 +0200 Message-ID: <20240705154410.14663-1-marcus.haehnel@kernkonzept.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: V5SY66V2JUTTRXKNUNPPVBWJIEQALZZC X-Message-ID-Hash: V5SY66V2JUTTRXKNUNPPVBWJIEQALZZC X-MailFrom: marcus.haehnel@kernkonzept.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Marcus Haehnel X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH] features.h: add clang prerequisite macro List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This can be used to guard fatures for specific clang versions. --- include/features.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/features.h b/include/features.h index b5d4e79f2..1a4efb9db 100644 --- a/include/features.h +++ b/include/features.h @@ -140,6 +140,18 @@ # define __GNUC_PREREQ(maj, min) 0 #endif +/* Convenience macro to test the version of clang. + Use like this: + #if __CLANG_PREREQ(3,2) + ... code requiring clang 3.2 or later ... + #endif */ +#if defined __clang__ +# define __CLANG_PREREQ(maj, min) \ + ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min)) +#else +# define __CLANG_PREREQ(maj, min) 0 +#endif + /* Whether to use feature set F. */ #define __GLIBC_USE(F) __GLIBC_USE_ ## F