public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Complex type cleanup
@ 2014-09-29 11:14 Dominik Vogt
  2014-09-29 11:16 ` [PATCH 2/2] " Dominik Vogt
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Vogt @ 2014-09-29 11:14 UTC (permalink / raw)
  To: libffi-discuss

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

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

[-- Attachment #2: 0001-Define-FFI_TYPE_COMPLEX-only-on-supported-platforms.patch --]
[-- Type: text/x-diff, Size: 871 bytes --]

From 7371ddead2647c7098bc4ff6e2a08c8d03138d76 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-29 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-29 11:14 [PATCH 1/2] Complex type cleanup Dominik Vogt
2014-09-29 11:16 ` [PATCH 2/2] " Dominik Vogt

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 read-only IMAP folder(s) and NNTP newsgroup(s).