1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2016-04-07 23:46:45 +00:00
parent fea3ee2a27
commit 139579b501

6
dln.c
View file

@ -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) {