summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-02 02:18:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-02 02:18:14 +0000
commitf65180025b0055e1d28f24b97a438e3c6c1a6ed9 (patch)
treee903334465498db98681b9d6112ec141d0eb61bc /ext
parent59cfce150b970be1d66ad577ee4d26d9baa932a8 (diff)
tcltklib.c: remove RUBY_VERSION
* ext/tk/tcltklib.c (tcltklib_compile_info): remove RUBY_VERSION, use RUBY_API_VERSION instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/extconf.rb4
-rw-r--r--ext/tk/tcltklib.c19
2 files changed, 13 insertions, 10 deletions
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index d4b017c85a2..cb131f07b1b 100644
--- a/ext/tk/extconf.rb
+++ b/ext/tk/extconf.rb
@@ -2085,10 +2085,6 @@ if (TkLib_Config["tcltk-framework"] ||
$INSTALLFILES ||= []
$INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"]
- # create
- $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
- $defs << %[-DRUBY_RELEASE_DATE=\\"#{RUBY_RELEASE_DATE}\\"]
-
# remove harmful definitions.
$defs.delete_if{|x|/^-Du?intptr_t=/ =~ x}
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 81439670158..37d83fff485 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -12,11 +12,8 @@
#ifdef HAVE_RUBY_ENCODING_H
#include "ruby/encoding.h"
#endif
-#ifndef RUBY_VERSION
-#define RUBY_VERSION "(unknown version)"
-#endif
-#ifndef RUBY_RELEASE_DATE
-#define RUBY_RELEASE_DATE "unknown release-date"
+#ifdef HAVE_RUBY_VERSION_H
+#include "ruby/version.h"
#endif
#undef RUBY_UNTYPED_DATA_WARNING
@@ -10001,7 +9998,17 @@ tcltklib_compile_info(void)
VALUE ret;
static const char info[] =
"tcltklib " TCLTKLIB_RELEASE_DATE " "
- ":: Ruby" RUBY_VERSION" ("RUBY_RELEASE_DATE") "
+ ":: Ruby"
+#ifdef RUBY_API_VERSION_MAJOR
+ STRINGIZE(RUBY_API_VERSION_MAJOR)"."
+ STRINGIZE(RUBY_API_VERSION_MINOR)"."
+ STRINGIZE(RUBY_API_VERSION_TEENY)" "
+#else
+ RUBY_VERSION" "
+#endif
+#ifdef RUBY_RELEASE_DATE
+ "("RUBY_RELEASE_DATE") "
+#endif
#ifdef HAVE_NATIVETHREAD
"with"
#else