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
3 changes: 2 additions & 1 deletion ext/digest/digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

************************************************/

#define RB_DIGEST_WRAP_METADATA_LINKAGE RUBY_FUNC_EXPORTED
#include "digest.h"

static VALUE rb_mDigest;
Expand Down Expand Up @@ -543,7 +544,7 @@ static const rb_data_type_t metadata_type = {
{0},
};

RUBY_FUNC_EXPORTED VALUE
RB_DIGEST_WRAP_METADATA_LINKAGE VALUE
rb_digest_wrap_metadata(const rb_digest_metadata_t *meta)
{
return rb_obj_freeze(TypedData_Wrap_Struct(0, &metadata_type, (void *)meta));
Expand Down
10 changes: 9 additions & 1 deletion ext/digest/digest.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,21 @@ rb_id_metadata(void)
# define DIGEST_USE_RB_EXT_RESOLVE_SYMBOL 1
#endif

/* Declarations and definitions of the same function must carry the same
* attribute on MSVC, and digest.c has to export the definition so that
* statically linked extensions can find the symbol in libruby. */
#ifndef RB_DIGEST_WRAP_METADATA_LINKAGE
# define RB_DIGEST_WRAP_METADATA_LINKAGE extern
#endif

static inline VALUE
rb_digest_make_metadata(const rb_digest_metadata_t *meta)
{
#if defined(EXTSTATIC) && EXTSTATIC
/* The extension is built as a static library, so safe to refer to
* rb_digest_wrap_metadata directly. */
extern VALUE rb_digest_wrap_metadata(const rb_digest_metadata_t *meta);
RB_DIGEST_WRAP_METADATA_LINKAGE
VALUE rb_digest_wrap_metadata(const rb_digest_metadata_t *meta);
return rb_digest_wrap_metadata(meta);
#else
/* The extension is built as a shared library, so we can't refer
Expand Down