mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
18 lines
328 B
Ruby
Executable File
18 lines
328 B
Ruby
Executable File
#!/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
|
|
#if defined(#{name})#{name.start_with?('IPPROTO_') ? ' || defined(_WINSOCKAPI_)' : ''}
|
|
define_const(#{name});
|
|
#endif
|
|
CODE
|
|
}
|