From 2ceb5363f9b15cffd3901220463a1175a32b89f7 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 22 Sep 2023 16:14:09 -0400 Subject: Try to fix compilation on m68k Compilation is failing on m68k-linux with: ``` ./include/ruby/internal/static_assert.h:51:46: error: static assertion failed: "sizeof_method_def: offsetof(rb_method_definition_t, body)==8" 51 | # define RBIMPL_STATIC_ASSERT0 __extension__ _Static_assert | ^~~~~~~~~~~~~~ ./include/ruby/internal/static_assert.h:70:5: note: in expansion of macro 'RBIMPL_STATIC_ASSERT0' 70 | RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) | ^~~~~~~~~~~~~~~~~~~~~ ./internal/static_assert.h:13:24: note: in expansion of macro 'RBIMPL_STATIC_ASSERT' 13 | # define STATIC_ASSERT RBIMPL_STATIC_ASSERT | ^~~~~~~~~~~~~~~~~~~~ ./method.h:203:1: note: in expansion of macro 'STATIC_ASSERT' 203 | STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body)==8); | ^~~~~~~~~~~~~ ``` --- method.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'method.h') diff --git a/method.h b/method.h index ef096e543b..fece2e54c3 100644 --- a/method.h +++ b/method.h @@ -200,7 +200,7 @@ struct rb_method_definition_struct { struct rb_id_table; typedef struct rb_method_definition_struct rb_method_definition_t; -STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body)==8); +STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body) <= 8); #define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF) #define UNDEFINED_REFINED_METHOD_P(def) \ -- cgit v1.2.3