This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/2] Complex type cleanup


> I have two more small patches for complex type support to make it a
> bit easier to use.

> The macro FFI_TARGET_HAS_COMPLEX_TYPE is for internal use only.
> Once all targets implement complex type support it could be
> removed.

The second patch renames FFI_TARGET_HAS_COMPLEX_TYPE to
_FFI_TARGET_HAS_COMPLEX_TYPE to make the temporary nature of the
macro clearer.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany
>From d5d2dc79b6b7282865936425c0755c867dd02e87 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Mon, 29 Sep 2014 11:39:32 +0100
Subject: [PATCH 2/2] Rename FFI_TARGET_HAS_COMPLEX_TYPE to
 _FFI_TARGET_HAS_COMPLEX_TYPE

... to discourage using it as part of the interface as it is meant
as a temporary vehicle until all platforms have complex type
support.
---
 include/ffi.h.in     |    4 ++--
 src/prep_cif.c       |    4 ++--
 src/s390/ffitarget.h |    2 +-
 src/types.c          |    2 +-
 src/x86/ffitarget.h  |    2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/ffi.h.in b/include/ffi.h.in
index 870cfaf..4af6ce0 100644
--- a/include/ffi.h.in
+++ b/include/ffi.h.in
@@ -200,7 +200,7 @@ FFI_EXTERN ffi_type ffi_type_longdouble;
 #define ffi_type_longdouble ffi_type_double
 #endif
 
-#ifdef FFI_TARGET_HAS_COMPLEX_TYPE
+#ifdef _FFI_TARGET_HAS_COMPLEX_TYPE
 FFI_EXTERN ffi_type ffi_type_complex_float;
 FFI_EXTERN ffi_type ffi_type_complex_double;
 #if @HAVE_LONG_DOUBLE@
@@ -475,7 +475,7 @@ 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
+#ifdef _FFI_TARGET_HAS_COMPLEX_TYPE
 #define FFI_TYPE_COMPLEX    15
 #endif
 
diff --git a/src/prep_cif.c b/src/prep_cif.c
index be5eae3..8af5013 100644
--- a/src/prep_cif.c
+++ b/src/prep_cif.c
@@ -136,7 +136,7 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
   if ((cif->rtype->size == 0) && (initialize_aggregate(cif->rtype) != FFI_OK))
     return FFI_BAD_TYPEDEF;
 
-#ifndef FFI_TARGET_HAS_COMPLEX_TYPE
+#ifndef _FFI_TARGET_HAS_COMPLEX_TYPE
   if (rtype->type == FFI_TYPE_COMPLEX)
     abort();
 #endif
@@ -170,7 +170,7 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
       if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))
 	return FFI_BAD_TYPEDEF;
 
-#ifndef FFI_TARGET_HAS_COMPLEX_TYPE
+#ifndef _FFI_TARGET_HAS_COMPLEX_TYPE
       if ((*ptr)->type == FFI_TYPE_COMPLEX)
 	abort();
 #endif
diff --git a/src/s390/ffitarget.h b/src/s390/ffitarget.h
index 0e4868a..d42cb21 100644
--- a/src/s390/ffitarget.h
+++ b/src/s390/ffitarget.h
@@ -53,7 +53,7 @@ typedef enum ffi_abi {
 #endif
 
 #define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
-#define FFI_TARGET_HAS_COMPLEX_TYPE
+#define _FFI_TARGET_HAS_COMPLEX_TYPE
 
 /* ---- Definitions for closures ----------------------------------------- */
 
diff --git a/src/types.c b/src/types.c
index 7e80aec..ef4f151 100644
--- a/src/types.c
+++ b/src/types.c
@@ -97,7 +97,7 @@ const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL };
 FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE, FFI_LDBL_CONST);
 #endif
 
-#ifdef FFI_TARGET_HAS_COMPLEX_TYPE
+#ifdef _FFI_TARGET_HAS_COMPLEX_TYPE
 FFI_COMPLEX_TYPEDEF(float, float, const);
 FFI_COMPLEX_TYPEDEF(double, double, const);
 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
diff --git a/src/x86/ffitarget.h b/src/x86/ffitarget.h
index a236677..d43930e 100644
--- a/src/x86/ffitarget.h
+++ b/src/x86/ffitarget.h
@@ -50,7 +50,7 @@
 #endif
 
 #define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
-#define FFI_TARGET_HAS_COMPLEX_TYPE
+#define _FFI_TARGET_HAS_COMPLEX_TYPE
 
 /* ---- Generic type definitions ----------------------------------------- */
 
-- 
1.7.9.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]