summaryrefslogtreecommitdiffhomepage
path: root/src/gen.rb
diff options
context:
space:
mode:
authorTomoyuki Sahara <[email protected]>2013-05-21 13:17:34 +0900
committerTomoyuki Sahara <[email protected]>2013-05-21 13:17:34 +0900
commit49e53bca5df530d0356852d6ce675b6d0cbf6933 (patch)
treeed72794e9b1f5cb281bc5295ad64dfbe4f1ae7eb /src/gen.rb
downloadmruby-49e53bca5df530d0356852d6ce675b6d0cbf6933.tar.gz
mruby-49e53bca5df530d0356852d6ce675b6d0cbf6933.zip
Socket library for mruby.
Diffstat (limited to 'src/gen.rb')
-rwxr-xr-xsrc/gen.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gen.rb b/src/gen.rb
new file mode 100755
index 000000000..8423dc442
--- /dev/null
+++ b/src/gen.rb
@@ -0,0 +1,17 @@
+#!/usr/bin/env ruby
+
+Dir.chdir(File.dirname($0))
+
+f = File.open("const.cstub", "w")
+
+IO.readlines("const.def").each { |name|
+ name.sub(/^#.*/, "")
+ name.strip!
+ next if name.empty?
+
+ f.write <<CODE
+#ifdef #{name}
+ define_const(#{name});
+#endif
+CODE
+}