summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-ruby/ffi/files/ffi-1.14.2-32bit-long-double.patch')
-rw-r--r--dev-ruby/ffi/files/ffi-1.14.2-32bit-long-double.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/dev-ruby/ffi/files/ffi-1.14.2-32bit-long-double.patch b/dev-ruby/ffi/files/ffi-1.14.2-32bit-long-double.patch
new file mode 100644
index 000000000000..7373a8c28cda
--- /dev/null
+++ b/dev-ruby/ffi/files/ffi-1.14.2-32bit-long-double.patch
@@ -0,0 +1,19 @@
+https://bugs.gentoo.org/815130
+https://github.com/ffi/ffi/commit/315d66e7b0768856d589e15bf597f4816d5cd524
+
+From 0ef7a9d7d22c9a7779def3f8c7f0166d996a2401 Mon Sep 17 00:00:00 2001
+From: xtkoba <69125751+xtkoba@users.noreply.github.com>
+Date: Wed, 29 Sep 2021 19:24:44 +0900
+Subject: [PATCH] Keep `LONGDOUBLE_ADJ >= sizeof(long double)`
+
+--- a/ext/ffi_c/Call.c
++++ b/ext/ffi_c/Call.c
+@@ -71,7 +71,7 @@
+ #define FLOAT32_ADJ (4)
+ #define FLOAT64_ADJ (8)
+ #define ADDRESS_ADJ (sizeof(void *))
+-#define LONGDOUBLE_ADJ (ffi_type_longdouble.alignment)
++#define LONGDOUBLE_ADJ (ffi_type_longdouble.alignment > sizeof(long double) ? ffi_type_longdouble.alignment : sizeof(long double))
+
+ #endif /* USE_RAW */
+