mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
version.c: no exit in ruby_show_copyright
* include/ruby/backward.h (ruby_show_copyright_to_die): for source code backward compatibility. * ruby.c (process_options): return Qtrue to exit the process successfully. * version.c (ruby_show_copyright): no longer exit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1491c4189a
commit
7aab062ef3
6 changed files with 41 additions and 4 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Thu Jan 7 11:34:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* include/ruby/backward.h (ruby_show_copyright_to_die): for source
|
||||||
|
code backward compatibility.
|
||||||
|
|
||||||
|
* ruby.c (process_options): return Qtrue to exit the process
|
||||||
|
successfully.
|
||||||
|
|
||||||
|
* version.c (ruby_show_copyright): no longer exit.
|
||||||
|
|
||||||
Wed Jan 6 17:22:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Jan 6 17:22:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/optparse.rb (OptionParser#order!): add `into` optional
|
* lib/optparse.rb (OptionParser#order!): add `into` optional
|
||||||
|
|
4
NEWS
4
NEWS
|
@ -30,6 +30,10 @@ with all sufficient information, see the ChangeLog file or Redmine
|
||||||
|
|
||||||
=== C API updates
|
=== C API updates
|
||||||
|
|
||||||
|
* ruby_show_version() will no longer exits the process, if
|
||||||
|
RUBY_SHOW_COPYRIGHT_TO_DIE is set to 0. This will be the default in
|
||||||
|
the future.
|
||||||
|
|
||||||
=== Supported platform changes
|
=== Supported platform changes
|
||||||
|
|
||||||
=== Implementation improvements
|
=== Implementation improvements
|
||||||
|
|
20
include/ruby/backward.h
Normal file
20
include/ruby/backward.h
Normal file
|
@ -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 */
|
|
@ -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
|
RUBY_SYMBOL_EXPORT_END
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
1
ruby.c
1
ruby.c
|
@ -1414,6 +1414,7 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
|
||||||
}
|
}
|
||||||
if (opt->dump & DUMP_BIT(copyright)) {
|
if (opt->dump & DUMP_BIT(copyright)) {
|
||||||
ruby_show_copyright();
|
ruby_show_copyright();
|
||||||
|
return Qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!opt->e_script) {
|
if (!opt->e_script) {
|
||||||
|
|
|
@ -96,12 +96,10 @@ ruby_show_version(void)
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Prints the copyright notice of the CRuby interpreter to stdout and \em exits
|
/*! Prints the copyright notice of the CRuby interpreter to stdout. */
|
||||||
* this process successfully.
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
ruby_show_copyright(void)
|
ruby_show_copyright(void)
|
||||||
{
|
{
|
||||||
PRINT(copyright);
|
PRINT(copyright);
|
||||||
exit(EXIT_SUCCESS);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue