summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-05 01:40:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-05 01:40:24 +0000
commit10c93d6c7469e0b33f268c86e61ff87eb9ccbb9e (patch)
tree1cb15b97b59f3abc62c35b7691b8a5ececdbdc7d /ruby.c
parentaf8250ec340fa7d5b02739ecbad3519874253bdc (diff)
* 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
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ruby.c b/ruby.c
index e3c69c7..6d8caac 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;