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:
parent
fea3ee2a27
commit
139579b501
6
dln.c
6
dln.c
@ -1245,6 +1245,9 @@ rb_w32_check_imported(HMODULE ext, HMODULE mine)
|
|||||||
void*
|
void*
|
||||||
dln_load(const char *file)
|
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)
|
#if !defined(_AIX) && !defined(NeXT)
|
||||||
const char *error = 0;
|
const char *error = 0;
|
||||||
#define DLN_ERROR() (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error))
|
#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 defined _WIN32 && defined RUBY_EXPORT
|
||||||
if (!rb_w32_check_imported(handle, rb_libruby_handle())) {
|
if (!rb_w32_check_imported(handle, rb_libruby_handle())) {
|
||||||
FreeLibrary(handle);
|
FreeLibrary(handle);
|
||||||
error = "incompatible library version";
|
error = incompatible;
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1327,7 +1330,6 @@ dln_load(const char *file)
|
|||||||
}
|
}
|
||||||
# if defined RUBY_EXPORT
|
# if defined RUBY_EXPORT
|
||||||
{
|
{
|
||||||
static const char incompatible[] = "incompatible library version";
|
|
||||||
void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc");
|
void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc");
|
||||||
if (ex && ex != ruby_xmalloc) {
|
if (ex && ex != ruby_xmalloc) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user