summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/backward.h20
-rw-r--r--include/ruby/ruby.h4
2 files changed, 24 insertions, 0 deletions
diff --git a/include/ruby/backward.h b/include/ruby/backward.h
new file mode 100644
index 0000000000..4574cb98da
--- /dev/null
+++ b/include/ruby/backward.h
@@ -0,0 +1,20 @@
+#ifndef RUBY_RUBY_BACKWARD_H
+#define RUBY_RUBY_BACKWARD_H 1
+
+#ifndef RUBY_SHOW_COPYRIGHT_TO_DIE
+# define RUBY_SHOW_COPYRIGHT_TO_DIE 1
+#endif
+#if RUBY_SHOW_COPYRIGHT_TO_DIE
+/* for source code backward compatibility */
+DEPRECATED(static inline int ruby_show_copyright_to_die(int));
+static inline int
+ruby_show_copyright_to_die(int exitcode)
+{
+ ruby_show_copyright();
+ return exitcode;
+}
+#define ruby_show_copyright() /* defer EXIT_SUCCESS */ \
+ (exit(ruby_show_copyright_to_die(EXIT_SUCCESS)))
+#endif
+
+#endif /* RUBY_RUBY_BACKWARD_H */
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 14fe7c3e16..7aabf5bd68 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -2206,6 +2206,10 @@ void ruby_sig_finalize(void);
/*! @} */
+#if !defined RUBY_EXPORT && !defined RUBY_NO_OLD_COMPATIBILITY
+# include "ruby/backward.h"
+#endif
+
RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)