2020-04-10 01:11:40 -04:00
|
|
|
#ifndef RUBY_VERSION_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
|
|
#define RUBY_VERSION_H 1
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @author $Author$
|
|
|
|
* @date Wed May 13 12:56:56 JST 2009
|
|
|
|
* @copyright Copyright (C) 1993-2009 Yukihiro Matsumoto
|
|
|
|
* @copyright Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
|
|
|
* @copyright Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
|
|
|
* @copyright This file is a part of the programming language Ruby.
|
|
|
|
* Permission is hereby granted, to either redistribute and/or
|
|
|
|
* modify this file, provided that the conditions mentioned in the
|
|
|
|
* file COPYING are met. Consult the file for details.
|
|
|
|
*
|
2009-05-13 02:23:20 -04:00
|
|
|
* This file contains only
|
2015-12-25 00:12:16 -05:00
|
|
|
* - never-changeable information, and
|
2009-05-13 02:23:20 -04:00
|
|
|
* - interfaces accessible from extension libraries.
|
|
|
|
*
|
|
|
|
* Never try to check RUBY_VERSION_CODE etc in extension libraries,
|
|
|
|
* check the features with mkmf.rb instead.
|
|
|
|
*/
|
|
|
|
|
2021-06-07 22:25:50 -04:00
|
|
|
/**
|
|
|
|
* @name The origin.
|
|
|
|
*
|
|
|
|
* These information never change. Just written here to remember.
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** Author of this project. */
|
2009-05-13 02:23:20 -04:00
|
|
|
#define RUBY_AUTHOR "Yukihiro Matsumoto"
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/** Ruby's birth year. */
|
2009-05-13 02:23:20 -04:00
|
|
|
#define RUBY_BIRTH_YEAR 1993
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/** Ruby's birth month. */
|
2009-05-13 02:23:20 -04:00
|
|
|
#define RUBY_BIRTH_MONTH 2
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/** Ruby's birth day. */
|
2009-05-13 02:23:20 -04:00
|
|
|
#define RUBY_BIRTH_DAY 24
|
|
|
|
|
2021-06-07 22:25:50 -04:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name The API version.
|
|
|
|
*
|
|
|
|
* API version is different from binary version. These numbers are for API
|
|
|
|
* stability. When you have distinct API versions x and y, you cannot expect
|
|
|
|
* codes targeted to x also works for y.
|
|
|
|
*
|
|
|
|
* However let us repeat here that it's a BAD idea to check
|
|
|
|
* #RUBY_API_VERSION_CODE form extension libraries. Different API versions are
|
|
|
|
* just different. There is no such thing like upper compatibility.
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Major version. This digit changes sometimes for various reasons, but that
|
|
|
|
* doesn't mean a total rewrite. Practically when it comes to API versioning,
|
|
|
|
* major and minor version changes are equally catastrophic.
|
|
|
|
*/
|
2020-08-31 03:38:13 -04:00
|
|
|
#define RUBY_API_VERSION_MAJOR 3
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Minor version. As of writing this version changes annually. Greater
|
|
|
|
* version doesn't mean "better"; they just mean years passed.
|
|
|
|
*/
|
2021-12-25 09:56:01 -05:00
|
|
|
#define RUBY_API_VERSION_MINOR 2
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Teeny version. This digit is kind of reserved these days. Kept 0 for the
|
|
|
|
* entire 2.x era. Waiting for future uses.
|
|
|
|
*/
|
2012-01-06 09:13:27 -05:00
|
|
|
#define RUBY_API_VERSION_TEENY 0
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This macro is API versions encoded into a C integer.
|
|
|
|
*
|
|
|
|
* @note Use mkmf.
|
|
|
|
* @note Don't rely on it.
|
|
|
|
*/
|
2010-08-23 17:08:19 -04:00
|
|
|
#define RUBY_API_VERSION_CODE (RUBY_API_VERSION_MAJOR*10000+RUBY_API_VERSION_MINOR*100+RUBY_API_VERSION_TEENY)
|
|
|
|
|
2021-06-07 22:25:50 -04:00
|
|
|
/** @} */
|
|
|
|
|
2009-05-13 02:23:20 -04:00
|
|
|
#ifdef RUBY_EXTERN
|
2020-04-08 00:28:13 -04:00
|
|
|
/* Internal note: this file could be included from verconf.mk _before_
|
|
|
|
* generating config.h, on Windows. The #ifdef above is to trick such
|
|
|
|
* situation. */
|
2020-05-04 02:52:56 -04:00
|
|
|
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
2010-07-21 17:38:25 -04:00
|
|
|
|
2021-06-07 22:25:50 -04:00
|
|
|
/**
|
|
|
|
* @name Interfaces from extension libraries.
|
2009-05-13 02:23:20 -04:00
|
|
|
*
|
|
|
|
* Before using these infos, think thrice whether they are really
|
|
|
|
* necessary or not, and if the answer was yes, think twice a week
|
|
|
|
* later again.
|
2021-06-07 22:25:50 -04:00
|
|
|
*
|
|
|
|
* @{
|
2009-05-13 02:23:20 -04:00
|
|
|
*/
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/** API versions, in { major, minor, teeny } order. */
|
2010-08-23 17:08:19 -04:00
|
|
|
RUBY_EXTERN const int ruby_api_version[3];
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Stringised version.
|
|
|
|
*
|
|
|
|
* @note This is the runtime version, not the API version. For instance it
|
|
|
|
* was `"2.5.9"` when ::ruby_api_version was `{ 2, 5, 0 }`.
|
|
|
|
*/
|
2009-05-13 02:23:20 -04:00
|
|
|
RUBY_EXTERN const char ruby_version[];
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/** Date of release, in a C string. */
|
2009-05-13 02:23:20 -04:00
|
|
|
RUBY_EXTERN const char ruby_release_date[];
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Target platform identifier, in a C string.
|
|
|
|
*
|
|
|
|
* @note Seasoned UNIX programmers should beware that this "platform
|
|
|
|
* identifier" is our invention; not always identical to so-called
|
|
|
|
* target triplets that GNU systems use. For instance on @shyouhei's
|
|
|
|
* machine, ::ruby_platform is `"x64_64-linux"` while its target triplet
|
|
|
|
* is `x86_64-pc-linux-gnu`.
|
|
|
|
* @note Note also that we support Windows.
|
|
|
|
*/
|
2009-05-13 02:23:20 -04:00
|
|
|
RUBY_EXTERN const char ruby_platform[];
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is a monotonic increasing integer that describes specific "patch"
|
|
|
|
* level. You can know the exact changeset your binary is running by this info
|
|
|
|
* (and ::ruby_version), unless this is -1. -1 means there is no release yet
|
|
|
|
* for the version; ruby is actively developed. 0 means the initial GA version.
|
|
|
|
*/
|
2009-05-13 02:23:20 -04:00
|
|
|
RUBY_EXTERN const int ruby_patchlevel;
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is what `ruby -v` prints to the standard error. Something like:
|
2022-06-14 11:08:36 -04:00
|
|
|
* `"ruby 2.5.9p229 (2021-04-05 revision 67829) [x86_64-linux]"`. This doesn't
|
|
|
|
* include runtime options like a JIT being enabled.
|
2021-06-07 22:25:50 -04:00
|
|
|
*/
|
2009-05-13 02:23:20 -04:00
|
|
|
RUBY_EXTERN const char ruby_description[];
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/** Copyright notice. */
|
2009-05-13 02:23:20 -04:00
|
|
|
RUBY_EXTERN const char ruby_copyright[];
|
2021-06-07 22:25:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is just `"ruby"` for us. But different implementations can have
|
|
|
|
* different strings here.
|
|
|
|
*/
|
2009-05-13 02:23:20 -04:00
|
|
|
RUBY_EXTERN const char ruby_engine[];
|
2010-07-21 17:38:25 -04:00
|
|
|
|
2021-06-07 22:25:50 -04:00
|
|
|
/** @} */
|
|
|
|
|
2020-05-04 02:52:56 -04:00
|
|
|
RBIMPL_SYMBOL_EXPORT_END()
|
2009-05-13 02:23:20 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|