summaryrefslogtreecommitdiff
path: root/internal/compilers.h
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-12-04 10:26:41 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-12-26 20:45:12 +0900
commitc27bcd70574165d30bb3a9dc50a6b35fc419ab2b (patch)
treec70419a17f0c7d4fb92c03420678b5ba74c94bef /internal/compilers.h
parentadc49f0f9a1106fc5a81b5aba684ec1578ac7d6d (diff)
internal/gc.h rework
Improved readability by reducing the use of macros. Also moved some part of internal/compilers.h into this file, because it seems to be the right place for them.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2711
Diffstat (limited to 'internal/compilers.h')
-rw-r--r--internal/compilers.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/internal/compilers.h b/internal/compilers.h
index 781dd9cfc9..0f470937c5 100644
--- a/internal/compilers.h
+++ b/internal/compilers.h
@@ -236,22 +236,4 @@ rb_obj_builtin_type(VALUE obj)
# define BITFIELD(type, name, size) unsigned int name : size
#endif
-#if defined(USE_UNALIGNED_MEMBER_ACCESS) && USE_UNALIGNED_MEMBER_ACCESS && \
- (defined(__clang__) || GCC_VERSION_SINCE(9, 0, 0))
-#include "warnings.h"
-# define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \
- COMPILER_WARNING_PUSH; \
- COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \
- typeof(expr) unaligned_member_access_result = (expr); \
- COMPILER_WARNING_POP; \
- unaligned_member_access_result; \
-})
-#else
-# define UNALIGNED_MEMBER_ACCESS(expr) expr
-#endif
-#define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
-
-#undef RB_OBJ_WRITE
-#define RB_OBJ_WRITE(a, slot, b) UNALIGNED_MEMBER_ACCESS(rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__))
-
#endif /* INTERNAL_COMPILERS_H */