Bug #1236
closedRUBY_VERSION not defined
Description
=begin
Building from trunk with MSVC 2008.
ruby/config.h is generated with this line:
#define RUBY_LIB_VERSION STRINGIZE(RUBY_VERSION_MAJOR)"."STRINGIZE(RUBY_VERSION_MINOR)"."STRINGIZE(RUBY_VERSION_TEENY)
But RUBY_VERSION_MAJOR, RUBY_VERSION_MINOR, RUBY_VERSION_TEENY are not defined in this file or in any file that is installed. They are defined in trunk/version.h but that is not installed.
Nor is RUBY_VERSION defined.
This is an issue because libxml-ruby uses st.h, and thus needs code that looks like this:
#if RUBY_VERSION < "1.9.0"
#include <st.h>
#else
#include <ruby/st.h>
#endif
Right now that doesn't work because RUBY_VERSION is not defined.
=end
Updated by cfis (Charlie Savage) almost 16 years ago
=begin
Actually, the code would be more like this:
#if RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR < 9
#include <st.h>
#else
#include <ruby/st.h>
#endif
However, to do that with Ruby 1.8.6 appears to require including version.h, which doesn't appear to exist in Ruby 1.9.1. So how should this be done?
=end
Updated by nobu (Nobuyoshi Nakada) almost 16 years ago
=begin
Hi,
At Mon, 2 Mar 2009 08:51:07 +0900,
Charlie Savage wrote in [ruby-core:22614]:
ruby/config.h is generated with this line:
#define RUBY_LIB_VERSION STRINGIZE(RUBY_VERSION_MAJOR)"."STRINGIZE(RUBY_VERSION_MINOR)"."STRINGIZE(RUBY_VERSION_TEENY)
It's only for the purpose to initialize the load path. You
never use that macro.
This is an issue because libxml-ruby uses st.h, and thus needs code that looks like this:
#include <ruby.h>
#ifdef HAVE_RUBY_ST_H
include <ruby/st.h>¶
#else
include <st.h>¶
#endif
--
Nobu Nakada
=end
Updated by nobu (Nobuyoshi Nakada) almost 16 years ago
- Status changed from Open to Rejected
=begin
=end