# Changing the definition of RUBY\_VERSION\_CODE

**URL:** <https://www.ruby-forum.com/t/changing-the-definition-of-ruby-version-code/77293>\
**Category:** Development\
**Created:** [November 26, 2006, 11:20am UTC](https://www.ruby-forum.com/t/changing-the-definition-of-ruby-version-code/77293 "2006-11-26T11:20:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akinori\_MUSHA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Post date:** [November 26, 2006, 11:20am UTC](https://www.ruby-forum.com/t/changing-the-definition-of-ruby-version-code/77293/1 "2006-11-26T11:20:35Z")

</div>

e$B!!8=:\_!“e(B RUBY\_VERSION\_CODE e$B$Oe(B 185  
e$B$N$h$&$J;07e$NCM$KDj5A$5$l$Fe(B  
e$B$$$^$9$,!”:#2s$Ne(B patchlevel  
e$B$NF3F~$K8F1~$7$F0J2\<$N$h$&$KDj5A$re(B  
e$BJQ99$7$?$$$G$9!#$$$+$,$G$7$g$&$+!#e(B

#define RUBY\_VERSION\_CODE (10000UL \* (100 \* RUBY\_VERSION\_MAJOR +   
10 \* RUBY\_VERSION\_MINOR + RUBY\_VERSION\_TEENY) +   
RUBY\_VERSION\_PATCHLEVEL)

e$B!!F05!$O!“%P!\<%8%g%s$r\<($90l0U$J%7%j%”%kCM$,$"$k$N$,K\>$^$7$/!“e(B  
RUBY\_VERSION\_CODE  
e$B$,$=$&$G$”$C$F$[$7$$$H$$$&$3$H$G$9!#e(B(e$B$=$l$\>$le(B  
10e$B$N2?\>hG$9$k$+$OMW8!F$e(B)

e$B!!8\_49@-$G$9$,!“e(B Ruby  
e$B%l%Y%k$G$O!”$3$NDj?t$OO\*=P$7$F$$$J$$$N$Ge(B  
e$BLdBj$J$$$H;W$$$^$9!#$3$l$r5!$Ke(B Ruby e$B$K$b8+$;$?$$$G$9!#e(B

e$B!!e(BC e$B%l%Y%k$G$O!“!Ve(B#if RUBY\_VERSION\_CODE \>=  
185e$B!W$N$h$&$J2a5n$Ne(B  
e$BCM$H$NHf3S$OLdBj$”$j$^$;$s$,!"!Ve(B#if RUBY\_VERSION\_CODE \<  
190e$B!W$Ne(B  
e$B$h$&$JL$Mh$NCM$K4X$7$F$O2u$l$F$7$^$$$^$9!#$3$l$K$D$$$F$Oe(B:

- 1.9 e$B$r;kLn$KF~$l$F$$$k$/$i$$$J$N$GJQ99$KDI=\>$7$F$/$@$5$$e(B
- e$B$=$b$=$be(BCe$B%l%Y%k$Ge(B RUBY\_VERSION\_CODE  
e$B$J$I$KMj$i$J$$$G$/$@$5$$e(B  
(extconf.rb e$B$G$$$/$i$G$b5!G=$r%A%'%C%/$G$-$k$s$@$+$ie(B)

e$B$H$$$&$3$H$G$I$&$G$7$g$&!#$A$J$\_$K\<j85$G8!:w$7$?$H$3$m!“e(B180e$B$h$je(B  
e$BBg$-$JCM$HHf3S$7$F$$$kNc$O$[$H$s$I$”$j$^$;$s$G$7$?!#e(B(e$B?tNce(B)

–  
/  
/\_\_ \_\_ [Akinori.org](http://Akinori.org) / [MUSHA.org](http://MUSHA.org)  
/ ) ) ) ) / [FreeBSD.org](http://FreeBSD.org) / [Ruby-lang.org](http://Ruby-lang.org)  
Akinori MUSHA aka / (\_ / ( (\_\_( @ [iDaemons.org](http://iDaemons.org) / and.or.jp

“Different eyes see different things,  
Different hearts beat on different strings –  
But there are times for you and me when all such things agree”
