diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-07 23:46:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-07 23:46:45 +0000 |
commit | 139579b501c3475aec70a8bc5f102e759a286a85 (patch) | |
tree | 488a24f60cc22ed484a271765d589ab8e454f701 /dln.c | |
parent | fea3ee2a27fc72e7214dd9586002c599a0ec7446 (diff) | |
download | ruby-139579b501c3475aec70a8bc5f102e759a286a85.tar.gz |
dln.c: move error message definition
* dln.c (dln_load): move the definition of incompatible library
version error message to be shared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dln.c')
-rw-r--r-- | dln.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1245,6 +1245,9 @@ rb_w32_check_imported(HMODULE ext, HMODULE mine) void* dln_load(const char *file) { +#if (defined _WIN32 || defined USE_DLN_DLOPEN) && defined RUBY_EXPORT + static const char incompatible[] = "incompatible library version"; +#endif #if !defined(_AIX) && !defined(NeXT) const char *error = 0; #define DLN_ERROR() (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error)) @@ -1278,7 +1281,7 @@ dln_load(const char *file) #if defined _WIN32 && defined RUBY_EXPORT if (!rb_w32_check_imported(handle, rb_libruby_handle())) { FreeLibrary(handle); - error = "incompatible library version"; + error = incompatible; goto failed; } #endif @@ -1327,7 +1330,6 @@ dln_load(const char *file) } # if defined RUBY_EXPORT { - static const char incompatible[] = "incompatible library version"; void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc"); if (ex && ex != ruby_xmalloc) { |