mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* error.c (Init_syserr): moved to the template.
(errno_missing): removed. fixed [ruby-dev:35958]. * defs/knwon_errors.def: added. extracted from Init_syserr. * templates/known_errors.inc.tmpl: added. Template for Init_syserr. c.f. [ruby-dev:35958]. * tools/generic_erb.rb: added. general purpose mapper which maps data+template into source code. * common.mk (error.$(OBJEXT), incs, known_errors.inc): Fixed dependencies. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9ea58e6421
commit
16c95b42ce
6 changed files with 166 additions and 386 deletions
18
template/known_errors.inc.tmpl
Normal file
18
template/known_errors.inc.tmpl
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/** -*-c-*-
|
||||
* This file is automatically generated by tools/generic_erb.rb
|
||||
* DO NOT TOUCH!
|
||||
*
|
||||
* If you want to fix something, you should edit 'template/knwon_erros.inc.tmpl or defs/knwon_errors.def
|
||||
*/
|
||||
|
||||
% error_names = ARGF.read.split(/\s+/)
|
||||
void Init_syserr(void) {
|
||||
rb_eNOERROR = set_syserr(0, "NOERROR");
|
||||
% error_names.each do |name|
|
||||
#ifdef <%=name%>
|
||||
set_syserr(<%=name%>, "<%=name%>");
|
||||
#else
|
||||
set_syserr(0, "<%=name%>");
|
||||
#endif
|
||||
% end
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue