summaryrefslogtreecommitdiff
path: root/template/known_errors.inc.tmpl
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-26 08:18:49 (GMT)
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-26 08:18:49 (GMT)
commit16c95b42ced7119ba013b52486e8e68317353b9a (patch)
treec56ca478b5798e29c336e11a84a942ed3a970fa7 /template/known_errors.inc.tmpl
parent9ea58e64218d55d235cb732309f2665b2d31866f (diff)
* 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
Diffstat (limited to 'template/known_errors.inc.tmpl')
-rw-r--r--template/known_errors.inc.tmpl18
1 files changed, 18 insertions, 0 deletions
diff --git a/template/known_errors.inc.tmpl b/template/known_errors.inc.tmpl
new file mode 100644
index 0000000..86c23e1
--- /dev/null
+++ b/template/known_errors.inc.tmpl
@@ -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
+}