summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-19 09:28:43 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-19 09:28:43 +0000
commit89bd7ae4c157f46d4b35f29a68675feef73b5153 (patch)
tree8ffa76633d639e270ae2b65db31f967257e425af /ext
parent681a2b34aa3b1929858191bc70f49166c367c5d4 (diff)
* configure.in, defines.h, eval.c (rb_feature_p, rb_provided,
load_wait, search_required, rb_require_safe), ext/extmk.rb: Fix a bug where a statically linked extension cannot be autoloaded. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@11781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/extmk.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index ff1b184..ac396a0 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -451,14 +451,11 @@ unless $extlist.empty?
src = %{\
#include "ruby.h"
-#define init(func, name) { \
- void func _((void)); \
- ruby_sourcefile = src = rb_source_filename(name); \
- func(); \
- rb_provide(src); \
-}
+#define init(func, name) {void func _((void)); ruby_init_ext(name, func);}
+
+void ruby_init_ext _((const char *name, void (*init)(void)));
-void Init_ext _((void))\n{\n char *src;#$extinit}
+void Init_ext _((void))\n{\n#$extinit}
}
if !modified?(extinit.c, MTIMES) || IO.read(extinit.c) != src
open(extinit.c, "w") {|f| f.print src}