Skip to content

Commit

Permalink
Fix w32 error (don't redefine GC_API), should work on other archs
Browse files Browse the repository at this point in the history
  • Loading branch information
eudoxos committed Nov 30, 2023
1 parent e0c7869 commit e50560e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/gentl/private.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ gentl_error_quark (void)
return g_quark_from_static_string ("gentl-error-quark");
}

GC_API
GC_ERROR
gentl_init()
{
if (gentl_GCInitLib != 0)
Expand All @@ -77,7 +77,7 @@ gentl_init()
return GC_ERR_SUCCESS;
}

GC_API
GC_ERROR
gentl_fini()
{
GENTL_ENSURE_INIT;
Expand Down
11 changes: 2 additions & 9 deletions src/gentl/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,14 @@ size_t gentl_buf_size(INFO_DATATYPE,const void*);
GC_ERROR gentl_to_buf(INFO_DATATYPE type, void* dst, const void* src, size_t* sz, INFO_DATATYPE *piType) G_GNUC_WARN_UNUSED_RESULT;


/*
In our code, GC_API is used in implementation, so only specifies return type.
This is to allow verbatim copy of the function signature into the implementation file.
*/
#undef GC_API
#define GC_API GC_ERROR

#if defined(_WIN32) && defined(_MSC_VER)
#define GENTL_THREAD_LOCAL_STORAGE __declspec(thread)
#else
#define GENTL_THREAD_LOCAL_STORAGE __thread
#endif

GC_API gentl_init (void);
GC_API gentl_fini (void);
GC_ERROR gentl_init (void);
GC_ERROR gentl_fini (void);
gboolean gentl_is_initialized (void);

/*
Expand Down

0 comments on commit e50560e

Please sign in to comment.