ruby-changes:30842
From: nobu <ko1@a...>
Date: Thu, 12 Sep 2013 22:40:11 +0900 (JST)
Subject: [ruby-changes:30842] nobu:r42921 (trunk): configure.in: size_t must be unsigned
nobu 2013-09-12 22:40:06 +0900 (Thu, 12 Sep 2013) New Revision: 42921 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42921 Log: configure.in: size_t must be unsigned * configure.in (RUBY_CHECK_SIGNEDNESS): macro to check signedness of a type. * configure.in (size_t): must be unsigned. [ruby-core:57149] [Feature #8890] Modified files: trunk/ChangeLog trunk/configure.in Index: configure.in =================================================================== --- configure.in (revision 42920) +++ configure.in (revision 42921) @@ -1213,6 +1213,11 @@ elif test "x$ac_cv_type___int64" = xyes; https://github.com/ruby/ruby/blob/trunk/configure.in#L1213 RUBY_CHECK_PRINTF_PREFIX(__int64, ll I64, LL) fi +dnl RUBY_CHECK_SIZEOF [typename] [if-signed] [if-unsigned] [included] +AC_DEFUN([RUBY_CHECK_SIGNEDNESS], [dnl + AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])], [($1)-1 > 0])], + [$3], [$2])]) + dnl RUBY_REPLACE_TYPE [typename] [default type] [macro type] [included] AC_DEFUN([RUBY_REPLACE_TYPE], [dnl AC_CHECK_TYPE([$1], @@ -1225,10 +1230,7 @@ AC_DEFUN([RUBY_REPLACE_TYPE], [dnl https://github.com/ruby/ruby/blob/trunk/configure.in#L1230 [*" signed "*], [ ], [*" unsigned "*], [ u=U], - [ - AC_COMPILE_IFELSE( - [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])], [($n)-1 > 0])], - [u=U])]) + [RUBY_CHECK_SIGNEDNESS($n, [], [u=U], [$4])]) if test x"$t" = x; then for t in "long long" long int short; do test -n "$u" && t="unsigned $t" @@ -1514,6 +1516,8 @@ fi https://github.com/ruby/ruby/blob/trunk/configure.in#L1516 AC_TYPE_SIZE_T +RUBY_CHECK_SIGNEDNESS(size_t, [AC_MSG_ERROR(size_t is signed)], [], + [@%:@include <sys/types.h>]) RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>]) RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include <stddef.h>]) RUBY_CHECK_PRINTF_PREFIX(size_t, z) Index: ChangeLog =================================================================== --- ChangeLog (revision 42920) +++ ChangeLog (revision 42921) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Sep 12 22:40:03 2013 Nobuyoshi Nakada <nobu@r...> + + * configure.in (RUBY_CHECK_SIGNEDNESS): macro to check signedness of a + type. + + * configure.in (size_t): must be unsigned. + [ruby-core:57149] [Feature #8890] + Thu Sep 12 22:37:08 2013 Anton Ovchinnikov <revolver112@g...> * ext/bigdecimal/bigdecimal.c, ext/digest/md5/md5.c, -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/