Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/msgpack/buffer_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static size_t Buffer_memsize(const void *data)
return sizeof(msgpack_buffer_t) + msgpack_buffer_memsize(data);
}

const rb_data_type_t buffer_data_type = {
static const rb_data_type_t buffer_data_type = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder, is the static needed given the -fvisibility=hidden below?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but -fvisibility=hidden may not work on some platforms, or so I've heard. I still need to cleanup extconf to use append_cflags instead of $CFLAGS <<

.wrap_struct_name = "msgpack:buffer",
.function = {
.dmark = msgpack_buffer_mark,
Expand All @@ -66,7 +66,7 @@ const rb_data_type_t buffer_data_type = {
.flags = RUBY_TYPED_FREE_IMMEDIATELY
};

const rb_data_type_t buffer_view_data_type = {
static const rb_data_type_t buffer_view_data_type = {
.wrap_struct_name = "msgpack:buffer_view",
.function = {
.dmark = msgpack_buffer_mark,
Expand Down
2 changes: 2 additions & 0 deletions ext/msgpack/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
have_func("rb_enc_interned_str", "ruby.h") # Ruby 3.0+
have_func("rb_hash_new_capa", "ruby.h") # Ruby 3.2+

$CFLAGS << " -fvisibility=hidden "

unless RUBY_PLATFORM.include? 'mswin'
$CFLAGS << %[ -I.. -Wall -O3 #{RbConfig::CONFIG["debugflags"]} -std=gnu99]
end
Expand Down
2 changes: 1 addition & 1 deletion ext/msgpack/rbinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "factory_class.h"
#include "extension_value_class.h"

void Init_msgpack(void)
RUBY_FUNC_EXPORTED void Init_msgpack(void)
{
VALUE mMessagePack = rb_define_module("MessagePack");

Expand Down