From 7634b7e18ba73ce9468081b636e3c5d97fde78e8 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Mon, 24 Sep 2012 17:21:15 +0200 Subject: [PATCH] [PATCH 1/6] Provide a __has_attribute compatibility macro --- 87/acf2a1a524324cbc82d8a9d7a723e08d905903 | 110 ++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 87/acf2a1a524324cbc82d8a9d7a723e08d905903 diff --git a/87/acf2a1a524324cbc82d8a9d7a723e08d905903 b/87/acf2a1a524324cbc82d8a9d7a723e08d905903 new file mode 100644 index 000000000..21aae1f04 --- /dev/null +++ b/87/acf2a1a524324cbc82d8a9d7a723e08d905903 @@ -0,0 +1,110 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 570E6431FD0 + for ; Mon, 24 Sep 2012 08:21:45 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id oHSQ91Ek7asz for ; + Mon, 24 Sep 2012 08:21:43 -0700 (PDT) +Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 6255B431FD2 + for ; Mon, 24 Sep 2012 08:21:40 -0700 (PDT) +Received: from mail.jade-hamburg.de (mail.jade-hamburg.de [85.183.11.228]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.cryptobitch.de (Postfix) with ESMTPSA id 3D3EA5AB292 + for ; Mon, 24 Sep 2012 17:21:39 +0200 (CEST) +Received: by mail.jade-hamburg.de (Postfix, from userid 401) + id ADA42DF2A8; Mon, 24 Sep 2012 17:21:38 +0200 (CEST) +Received: from thinkbox.jade-hamburg.de (mail.jade-hamburg.de [85.183.11.228]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) (Authenticated sender: teythoon) + by mail.jade-hamburg.de (Postfix) with ESMTPSA id 06BC7DF2A1; + Mon, 24 Sep 2012 17:21:32 +0200 (CEST) +Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.80) + (envelope-from ) + id 1TGATQ-0007l2-Qi; Mon, 24 Sep 2012 17:21:28 +0200 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +To: notmuch@notmuchmail.org +Subject: [PATCH 1/6] Provide a __has_attribute compatibility macro +Date: Mon, 24 Sep 2012 17:21:15 +0200 +Message-Id: + <1348500080-29726-1-git-send-email-4winter@informatik.uni-hamburg.de> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <873927eb5i.fsf@convex-new.cs.unb.ca> +References: <873927eb5i.fsf@convex-new.cs.unb.ca> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 24 Sep 2012 15:21:45 -0000 + +__has_attribute is defined by clang and tests whether a given function +attribute is supported by clang. + +Add a compatibility macro for other compilers. + +Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de> +--- + compat/function-attributes.h | 31 +++++++++++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + create mode 100644 compat/function-attributes.h + +diff --git a/compat/function-attributes.h b/compat/function-attributes.h +new file mode 100644 +index 0000000..18f9090 +--- /dev/null ++++ b/compat/function-attributes.h +@@ -0,0 +1,31 @@ ++/* function-attributes.h - Provides compiler abstractions for ++ * function attributes ++ * ++ * Copyright (c) 2012 Justus Winter <4winter@informatik.uni-hamburg.de> ++ * ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see http://www.gnu.org/licenses/ . ++ */ ++ ++#ifndef FUNCTION_ATTRIBUTES_H ++#define FUNCTION_ATTRIBUTES_H ++ ++/* clang provides this macro to test for support for function ++ * attributes. If it isn't defined, this provides a compatibility ++ * macro for other compilers. ++ */ ++#ifndef __has_attribute ++#define __has_attribute(x) 0 ++#endif ++ ++#endif +-- +1.7.10.4 + -- 2.26.2