From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18894 invoked by alias); 29 Sep 2014 11:14:47 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 18874 invoked by uid 89); 29 Sep 2014 11:14:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp11.uk.ibm.com Received: from e06smtp11.uk.ibm.com (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 29 Sep 2014 11:14:45 +0000 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Sep 2014 12:14:41 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 29 Sep 2014 12:14:39 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id EA5FA17D805F for ; Mon, 29 Sep 2014 12:16:47 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8TBEcvu61931542 for ; Mon, 29 Sep 2014 11:14:38 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8TBEceb024501 for ; Mon, 29 Sep 2014 05:14:38 -0600 Received: from bl3ahm9f.de.ibm.com (dyn-9-152-212-217.boeblingen.de.ibm.com [9.152.212.217]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s8TBEcBE024480 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Mon, 29 Sep 2014 05:14:38 -0600 Received: from dvogt by bl3ahm9f.de.ibm.com with local (Exim 4.76) (envelope-from ) id 1XYYub-0004Mj-J7; Mon, 29 Sep 2014 13:14:37 +0200 Date: Mon, 29 Sep 2014 11:14:00 -0000 From: Dominik Vogt To: libffi-discuss@sourceware.org Subject: [PATCH 1/2] Complex type cleanup Message-ID: <20140929111437.GA16165@linux.vnet.ibm.com> Reply-To: vogt@linux.vnet.ibm.com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14092911-5024-0000-0000-000001773B84 X-IsSubscribed: yes X-SW-Source: 2014/txt/msg00094.txt.bz2 --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 561 I have two more small patches for complex type support to make it a bit easier to use. The first patch makes sure that FFI_TYPE_COMPLEX is only defined on a system that has complex support in libffi, so the user can say something like #ifdef FFI_TARGET_HAS_COMPLEX_TYPE /* (code with complex support) */ #else /* (code without complex support) */ #endif The macro FFI_TARGET_HAS_COMPLEX_TYPE is for internal use only. Once all targets implement complex type support it could be removed. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany --/9DWx/yDrRhgMJTb Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Define-FFI_TYPE_COMPLEX-only-on-supported-platforms.patch" Content-length: 872 >From 7371ddead2647c7098bc4ff6e2a08c8d03138d76 Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Mon, 29 Sep 2014 11:38:56 +0100 Subject: [PATCH 1/2] Define FFI_TYPE_COMPLEX only on supported platforms. --- include/ffi.h.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/ffi.h.in b/include/ffi.h.in index f403ae0..870cfaf 100644 --- a/include/ffi.h.in +++ b/include/ffi.h.in @@ -475,10 +475,12 @@ void ffi_call(ffi_cif *cif, #define FFI_TYPE_SINT64 12 #define FFI_TYPE_STRUCT 13 #define FFI_TYPE_POINTER 14 +#ifdef FFI_TARGET_HAS_COMPLEX_TYPE #define FFI_TYPE_COMPLEX 15 +#endif /* This should always refer to the last type code (for sanity checks) */ -#define FFI_TYPE_LAST FFI_TYPE_COMPLEX +#define FFI_TYPE_LAST (FFI_TYPE_POINTER + 1) #ifdef __cplusplus } -- 1.7.9.5 --/9DWx/yDrRhgMJTb--