Skip to content

Commit cd78b53

Browse files
author
Anthony Green
committed
Always define long double types.
1 parent 012fcaf commit cd78b53

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

include/ffi.h.in

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -----------------------------------------------------------------*-C-*-
22
libffi @VERSION@
3-
- Copyright (c) 2011, 2014, 2019, 2021, 2022 Anthony Green
3+
- Copyright (c) 2011, 2014, 2019, 2021, 2022, 2024 Anthony Green
44
- Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
55
66
Permission is hereby granted, free of charge, to any person
@@ -220,21 +220,12 @@ FFI_EXTERN ffi_type ffi_type_sint64;
220220
FFI_EXTERN ffi_type ffi_type_float;
221221
FFI_EXTERN ffi_type ffi_type_double;
222222
FFI_EXTERN ffi_type ffi_type_pointer;
223-
224-
#if @HAVE_LONG_DOUBLE@
225223
FFI_EXTERN ffi_type ffi_type_longdouble;
226-
#else
227-
#define ffi_type_longdouble ffi_type_double
228-
#endif
229224

230225
#ifdef FFI_TARGET_HAS_COMPLEX_TYPE
231226
FFI_EXTERN ffi_type ffi_type_complex_float;
232227
FFI_EXTERN ffi_type ffi_type_complex_double;
233-
#if @HAVE_LONG_DOUBLE@
234228
FFI_EXTERN ffi_type ffi_type_complex_longdouble;
235-
#else
236-
#define ffi_type_complex_longdouble ffi_type_complex_double
237-
#endif
238229
#endif
239230
#endif /* LIBFFI_HIDE_BASIC_TYPES */
240231

libffi.map.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ LIBFFI_BASE_8.0 {
2020
ffi_type_sint64;
2121
ffi_type_float;
2222
ffi_type_double;
23-
#if defined(HAVE_LONG_DOUBLE) || defined(HAVE_LONG_DOUBLE_VARIANT)
2423
ffi_type_longdouble;
25-
#endif
2624
ffi_type_pointer;
2725

2826
/* Exported functions. */
@@ -54,9 +52,7 @@ LIBFFI_COMPLEX_8.0 {
5452
/* Exported data variables. */
5553
ffi_type_complex_float;
5654
ffi_type_complex_double;
57-
#if defined(HAVE_LONG_DOUBLE) || defined(HAVE_LONG_DOUBLE_VARIANT)
5855
ffi_type_complex_longdouble;
59-
#endif
6056
} LIBFFI_BASE_8.0;
6157
#endif
6258

src/types.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -----------------------------------------------------------------------
2-
types.c - Copyright (c) 1996, 1998 Red Hat, Inc.
3-
2+
types.c - Copyright (c) 1996, 1998, 2024 Red Hat, Inc.
3+
44
Predefined ffi_types needed by libffi.
55
66
Permission is hereby granted, free of charge, to any person obtaining
@@ -87,22 +87,20 @@ FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE, const);
8787
#endif
8888

8989
#ifdef __alpha__
90-
/* Even if we're not configured to default to 128-bit long double,
90+
/* Even if we're not configured to default to 128-bit long double,
9191
maintain binary compatibility, as -mlong-double-128 can be used
9292
at any time. */
9393
/* Validate the hard-coded number below. */
9494
# if defined(__LONG_DOUBLE_128__) && FFI_TYPE_LONGDOUBLE != 4
9595
# error FFI_TYPE_LONGDOUBLE out of date
9696
# endif
9797
const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL };
98-
#elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
98+
#else
9999
FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE, FFI_LDBL_CONST);
100100
#endif
101101

102102
#ifdef FFI_TARGET_HAS_COMPLEX_TYPE
103103
FFI_COMPLEX_TYPEDEF(float, float, const);
104104
FFI_COMPLEX_TYPEDEF(double, double, const);
105-
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
106105
FFI_COMPLEX_TYPEDEF(longdouble, long double, FFI_LDBL_CONST);
107106
#endif
108-
#endif

0 commit comments

Comments
 (0)