From cd78b539125ae615d76df5a57039fe70ebd56c27 Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Sun, 18 Feb 2024 07:48:51 -0500 Subject: [PATCH] Always define long double types. --- include/ffi.h.in | 11 +---------- libffi.map.in | 4 ---- src/types.c | 10 ++++------ 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/include/ffi.h.in b/include/ffi.h.in index ecfe60a..e5c1dae 100644 --- a/include/ffi.h.in +++ b/include/ffi.h.in @@ -1,6 +1,6 @@ /* -----------------------------------------------------------------*-C-*- libffi @VERSION@ - - Copyright (c) 2011, 2014, 2019, 2021, 2022 Anthony Green + - Copyright (c) 2011, 2014, 2019, 2021, 2022, 2024 Anthony Green - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. Permission is hereby granted, free of charge, to any person @@ -220,21 +220,12 @@ FFI_EXTERN ffi_type ffi_type_sint64; FFI_EXTERN ffi_type ffi_type_float; FFI_EXTERN ffi_type ffi_type_double; FFI_EXTERN ffi_type ffi_type_pointer; - -#if @HAVE_LONG_DOUBLE@ FFI_EXTERN ffi_type ffi_type_longdouble; -#else -#define ffi_type_longdouble ffi_type_double -#endif #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@ FFI_EXTERN ffi_type ffi_type_complex_longdouble; -#else -#define ffi_type_complex_longdouble ffi_type_complex_double -#endif #endif #endif /* LIBFFI_HIDE_BASIC_TYPES */ diff --git a/libffi.map.in b/libffi.map.in index 384e44c..08c50b2 100644 --- a/libffi.map.in +++ b/libffi.map.in @@ -20,9 +20,7 @@ LIBFFI_BASE_8.0 { ffi_type_sint64; ffi_type_float; ffi_type_double; -#if defined(HAVE_LONG_DOUBLE) || defined(HAVE_LONG_DOUBLE_VARIANT) ffi_type_longdouble; -#endif ffi_type_pointer; /* Exported functions. */ @@ -54,9 +52,7 @@ LIBFFI_COMPLEX_8.0 { /* Exported data variables. */ ffi_type_complex_float; ffi_type_complex_double; -#if defined(HAVE_LONG_DOUBLE) || defined(HAVE_LONG_DOUBLE_VARIANT) ffi_type_complex_longdouble; -#endif } LIBFFI_BASE_8.0; #endif diff --git a/src/types.c b/src/types.c index 9ec27f6..c1c27f3 100644 --- a/src/types.c +++ b/src/types.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- - types.c - Copyright (c) 1996, 1998 Red Hat, Inc. - + types.c - Copyright (c) 1996, 1998, 2024 Red Hat, Inc. + Predefined ffi_types needed by libffi. Permission is hereby granted, free of charge, to any person obtaining @@ -87,7 +87,7 @@ FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE, const); #endif #ifdef __alpha__ -/* Even if we're not configured to default to 128-bit long double, +/* Even if we're not configured to default to 128-bit long double, maintain binary compatibility, as -mlong-double-128 can be used at any time. */ /* Validate the hard-coded number below. */ @@ -95,14 +95,12 @@ FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE, const); # error FFI_TYPE_LONGDOUBLE out of date # endif const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL }; -#elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +#else FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE, FFI_LDBL_CONST); #endif #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 FFI_COMPLEX_TYPEDEF(longdouble, long double, FFI_LDBL_CONST); #endif -#endif -- 2.34.1