Ruby 3.5.0dev (2025-01-10 revision 5fab31b15e32622c4b71d1d347a41937e9f9c212)
version.h (5fab31b15e32622c4b71d1d347a41937e9f9c212)
1#ifndef RUBY_TOPLEVEL_VERSION_H /*-*-C-*-vi:se ft=c:*/
2#define RUBY_TOPLEVEL_VERSION_H
10# define RUBY_VERSION_MAJOR RUBY_API_VERSION_MAJOR
11# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
12#define RUBY_VERSION_TEENY 0
13#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
14#define RUBY_PATCHLEVEL -1
15
16#include "ruby/version.h"
17#include "ruby/internal/abi.h"
18
19#ifndef RUBY_REVISION
20#include "revision.h"
21
22#ifndef TOKEN_PASTE
23#define TOKEN_PASTE(x,y) x##y
24#endif
25#define ONLY_ONE_DIGIT(x) TOKEN_PASTE(10,x) < 1000
26#define WITH_ZERO_PADDING(x) TOKEN_PASTE(0,x)
27#define RUBY_BIRTH_YEAR_STR STRINGIZE(RUBY_BIRTH_YEAR)
28#define RUBY_RELEASE_YEAR_STR STRINGIZE(RUBY_RELEASE_YEAR)
29#if ONLY_ONE_DIGIT(RUBY_RELEASE_MONTH)
30#define RUBY_RELEASE_MONTH_STR STRINGIZE(WITH_ZERO_PADDING(RUBY_RELEASE_MONTH))
31#else
32#define RUBY_RELEASE_MONTH_STR STRINGIZE(RUBY_RELEASE_MONTH)
33#endif
34#if ONLY_ONE_DIGIT(RUBY_RELEASE_DAY)
35#define RUBY_RELEASE_DAY_STR STRINGIZE(WITH_ZERO_PADDING(RUBY_RELEASE_DAY))
36#else
37#define RUBY_RELEASE_DAY_STR STRINGIZE(RUBY_RELEASE_DAY)
38#endif
39
40#endif
41
42#ifdef RUBY_ABI_VERSION
43# define RUBY_ABI_VERSION_SUFFIX "+"STRINGIZE(RUBY_ABI_VERSION)
44#else
45# define RUBY_ABI_VERSION_SUFFIX ""
46#endif
47#if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE
48# if RUBY_LIB_VERSION_STYLE == 3
49# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR) \
50 "."STRINGIZE(RUBY_API_VERSION_TEENY) RUBY_ABI_VERSION_SUFFIX
51# elif RUBY_LIB_VERSION_STYLE == 2
52# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR) \
53 RUBY_ABI_VERSION_SUFFIX
54# endif
55#endif
56
57#if RUBY_PATCHLEVEL == -1
58# ifdef RUBY_PATCHLEVEL_NAME
59# define RUBY_PATCHLEVEL_STR STRINGIZE(RUBY_PATCHLEVEL_NAME)
60# else
61# define RUBY_PATCHLEVEL_STR "dev"
62# endif
63#elif defined RUBY_ABI_VERSION
64# error RUBY_ABI_VERSION is defined in non-development branch
65#else
66# define RUBY_PATCHLEVEL_STR ""
67#endif
68
69#endif /* RUBY_TOPLEVEL_VERSION_H */