Skip to content

Commit 70a83d5

Browse files
authored
Merge pull request #317 from Shopify/hide-symbols
Hide all the symbols by defaults to avoid conflict
2 parents c45696a + cdb3cb9 commit 70a83d5

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

ext/msgpack/buffer_class.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static size_t Buffer_memsize(const void *data)
5656
return sizeof(msgpack_buffer_t) + msgpack_buffer_memsize(data);
5757
}
5858

59-
const rb_data_type_t buffer_data_type = {
59+
static const rb_data_type_t buffer_data_type = {
6060
.wrap_struct_name = "msgpack:buffer",
6161
.function = {
6262
.dmark = msgpack_buffer_mark,
@@ -66,7 +66,7 @@ const rb_data_type_t buffer_data_type = {
6666
.flags = RUBY_TYPED_FREE_IMMEDIATELY
6767
};
6868

69-
const rb_data_type_t buffer_view_data_type = {
69+
static const rb_data_type_t buffer_view_data_type = {
7070
.wrap_struct_name = "msgpack:buffer_view",
7171
.function = {
7272
.dmark = msgpack_buffer_mark,

ext/msgpack/extconf.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
have_func("rb_enc_interned_str", "ruby.h") # Ruby 3.0+
66
have_func("rb_hash_new_capa", "ruby.h") # Ruby 3.2+
77

8+
$CFLAGS << " -fvisibility=hidden "
9+
810
unless RUBY_PLATFORM.include? 'mswin'
911
$CFLAGS << %[ -I.. -Wall -O3 #{RbConfig::CONFIG["debugflags"]} -std=gnu99]
1012
end

ext/msgpack/rbinit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "factory_class.h"
2323
#include "extension_value_class.h"
2424

25-
void Init_msgpack(void)
25+
RUBY_FUNC_EXPORTED void Init_msgpack(void)
2626
{
2727
VALUE mMessagePack = rb_define_module("MessagePack");
2828

0 commit comments

Comments
 (0)