ruby-changes:42440
From: nobu <ko1@a...>
Date: Fri, 8 Apr 2016 07:50:09 +0900 (JST)
Subject: [ruby-changes:42440] nobu:r54514 (trunk): dln.c: move error message definition
nobu 2016-04-08 08:46:45 +0900 (Fri, 08 Apr 2016) New Revision: 54514 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54514 Log: dln.c: move error message definition * dln.c (dln_load): move the definition of incompatible library version error message to be shared. Modified files: trunk/dln.c Index: dln.c =================================================================== --- dln.c (revision 54513) +++ dln.c (revision 54514) @@ -1245,6 +1245,9 @@ rb_w32_check_imported(HMODULE ext, HMODU https://github.com/ruby/ruby/blob/trunk/dln.c#L1245 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) https://github.com/ruby/ruby/blob/trunk/dln.c#L1281 #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) https://github.com/ruby/ruby/blob/trunk/dln.c#L1330 } # if defined RUBY_EXPORT { - static const char incompatible[] = "incompatible library version"; void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc"); if (ex && ex != ruby_xmalloc) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/