ruby-changes:41403
From: nobu <ko1@a...>
Date: Sat, 9 Jan 2016 09:22:46 +0900 (JST)
Subject: [ruby-changes:41403] nobu:r53475 (trunk): RUBY_RELEASE_DATE in verconf.mk
nobu 2016-01-09 09:23:04 +0900 (Sat, 09 Jan 2016) New Revision: 53475 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53475 Log: RUBY_RELEASE_DATE in verconf.mk * win32/setup.mak (verconf.mk): extract RUBY_RELEASE_DATE without quotation marks. Modified files: trunk/version.h trunk/win32/setup.mak Index: win32/setup.mak =================================================================== --- win32/setup.mak (revision 53474) +++ win32/setup.mak (revision 53475) @@ -128,18 +128,16 @@ MSC_VER = _MSC_VER https://github.com/ruby/ruby/blob/trunk/win32/setup.mak#L128 << verconf.mk: nul - @$(CPP) -I$(srcdir) -I$(srcdir)/include <<"Creating $(@)" | findstr "=" >$(@) + @$(CPP) -I$(srcdir) -I$(srcdir)/include <<"Creating $(@)" > $(*F).bat && cmd /c $(*F).bat > $(@) +@echo off #define RUBY_REVISION 0 +#define STRINGIZE0(expr) #expr +#define STRINGIZE(x) STRINGIZE0(x) #include "version.h" -release_year = RUBY_RELEASE_YEAR -release_month = RUBY_RELEASE_MONTH -release_day = RUBY_RELEASE_DAY -#undef RUBY_RELEASE_YEAR -#undef RUBY_RELEASE_MONTH -#undef RUBY_RELEASE_DAY -RUBY_RELEASE_YEAR = $$(release_year) -RUBY_RELEASE_MONTH = $$(release_month) -RUBY_RELEASE_DAY = $$(release_day) +for %%I in (RUBY_RELEASE_DATE) do set ruby_release_date=%%~I +#undef RUBY_RELEASE_DATE +echo RUBY_RELEASE_DATE = %ruby_release_date:""=% +del %0 & exit << -program-name-: Index: version.h =================================================================== --- version.h (revision 53474) +++ version.h (revision 53475) @@ -12,15 +12,15 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L12 #define TOKEN_PASTE(x,y) x##y #endif #define ONLY_ONE_DIGIT(x) TOKEN_PASTE(10,x) < 1000 -#define ZERO_STR "0" +#define WITH_ZERO_PADDING(x) TOKEN_PASTE(0,x) #define RUBY_RELEASE_YEAR_STR STRINGIZE(RUBY_RELEASE_YEAR) #if ONLY_ONE_DIGIT(RUBY_RELEASE_MONTH) -#define RUBY_RELEASE_MONTH_STR ZERO_STR STRINGIZE(RUBY_RELEASE_MONTH) +#define RUBY_RELEASE_MONTH_STR STRINGIZE(WITH_ZERO_PADDING(RUBY_RELEASE_MONTH)) #else #define RUBY_RELEASE_MONTH_STR STRINGIZE(RUBY_RELEASE_MONTH) #endif #if ONLY_ONE_DIGIT(RUBY_RELEASE_DAY) -#define RUBY_RELEASE_DAY_STR ZERO_STR STRINGIZE(RUBY_RELEASE_DAY) +#define RUBY_RELEASE_DAY_STR STRINGIZE(WITH_ZERO_PADDING(RUBY_RELEASE_DAY)) #else #define RUBY_RELEASE_DAY_STR STRINGIZE(RUBY_RELEASE_DAY) #endif -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/