summaryrefslogtreecommitdiff
path: root/dev-ruby/ffi/files/ffi-1.14.2-32bit-long-double.patch
blob: 7373a8c28cda91afd51fc64067c4159abafc5b43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 */