summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSutou Kouhei <kou@clear-code.com>2023-09-06 13:59:29 +0900
committerSutou Kouhei <kou@cozmixng.org>2023-09-09 07:30:04 +0900
commit90dad2b12849b9151f62b1f3a9ac6090aadc8cc8 (patch)
tree3344e26dae71699e396b892f10aa722feefbeff0 /include
parentd9ede18154e125453bc6399463c58603b9a576a8 (diff)
memory_view: Avoid using bit field
Bit field's memory layout is implementation-defined. See also: https://wiki.sei.cmu.edu/confluence/display/c/EXP11-C.+Do+not+make+assumptions+regarding+the+layout+of+structures+with+bit-fields If memory layout is implementation-defined, it's difficult to use from FFI library such as Ruby-FFI.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8380
Diffstat (limited to 'include')
-rw-r--r--include/ruby/memory_view.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/ruby/memory_view.h b/include/ruby/memory_view.h
index 1ddca2d46f..42309d5afc 100644
--- a/include/ruby/memory_view.h
+++ b/include/ruby/memory_view.h
@@ -47,10 +47,10 @@ typedef struct {
char format;
/** :FIXME: what is a "native" size is unclear. */
- unsigned native_size_p: 1;
+ bool native_size_p;
/** Endian of the component */
- unsigned little_endian_p: 1;
+ bool little_endian_p;
/** The component's offset. */
size_t offset;