From 10c93d6c7469e0b33f268c86e61ff87eb9ccbb9e Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 5 Jan 2003 01:40:24 +0000 Subject: * ruby.c (ruby_init_loadpath): under Windows, get the module path from an internal address instead of hard coded library name. * cygwin/GNUmakefile.in, bcc32/Makefile.sub, win32/Makefile.sub (CPPFLAGS): removed LIBRUBY_SO macro. * bcc32/Makefile.sub, win32/Makefile.sub (config.h): no longer depends on makefiles. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index e3c69c797d..6d8caacc75 100644 --- a/ruby.c +++ b/ruby.c @@ -238,11 +238,12 @@ ruby_init_loadpath() char *p; int rest; #if defined _WIN32 || defined __CYGWIN__ -# if defined LIBRUBY_SO - HMODULE libruby = GetModuleHandle(LIBRUBY_SO); -# else HMODULE libruby = NULL; -# endif + MEMORY_BASIC_INFORMATION m; + + memset(&m, 0, sizeof(m)); + if (VirtualQuery(ruby_init_loadpath, &m, sizeof(m)) && m.State == MEM_COMMIT) + libruby = (HMODULE)m.AllocationBase; GetModuleFileName(libruby, libpath, sizeof libpath); #elif defined(DJGPP) extern char *__dos_argv0; -- cgit v1.2.3