summaryrefslogtreecommitdiff
path: root/ext/-test-/RUBY_ALIGNOF/cpp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/-test-/RUBY_ALIGNOF/cpp.cpp')
-rw-r--r--ext/-test-/RUBY_ALIGNOF/cpp.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/-test-/RUBY_ALIGNOF/cpp.cpp b/ext/-test-/RUBY_ALIGNOF/cpp.cpp
new file mode 100644
index 0000000000..ea1211c38c
--- /dev/null
+++ b/ext/-test-/RUBY_ALIGNOF/cpp.cpp
@@ -0,0 +1,15 @@
+#include "ruby.h"
+#include <cstddef>
+
+struct T {
+ char _;
+ double t;
+};
+
+RBIMPL_STATIC_ASSERT(RUBY_ALIGNOF, RUBY_ALIGNOF(double) == offsetof(T, t));
+
+extern "C" void
+Init_RUBY_ALIGNOF()
+{
+ // Windows linker mandates this symbol to exist.
+}