diff --git a/ChangeLog b/ChangeLog index 2f2b527998..5f8d3a4f6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Mar 6 23:45:40 2011 KOSAKI Motohiro + + * configure.in: rlim_t use standard RUBY_REPLACE_TYPE mechanism. + Sun Mar 6 23:26:07 2011 KOSAKI Motohiro * process.c (proc_setmaxgroups): added negative value check. diff --git a/configure.in b/configure.in index 9225bc8ef1..b551d67947 100644 --- a/configure.in +++ b/configure.in @@ -689,6 +689,7 @@ RUBY_REPLACE_TYPE(gid_t, int, GIDT) RUBY_REPLACE_TYPE(time_t, [], TIMET, [@%:@include ]) RUBY_REPLACE_TYPE(dev_t, [int long "long long"], DEVT) RUBY_REPLACE_TYPE(mode_t, ["unsigned int" long], MODET, [@%:@include ]) +RUBY_REPLACE_TYPE(rlim_t, [int long "long long"], RLIM, [@%:@include ]) AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes, [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);], @@ -1126,23 +1127,6 @@ AC_CHECK_HEADERS(limits.h sys/file.h sys/ioctl.h sys/syscall.h\ ucontext.h intrinsics.h langinfo.h locale.h sys/sendfile.h time.h \ net/socket.h sys/socket.h) -dnl Check additional types. -RUBY_CHECK_SIZEOF(rlim_t, [int long "long long"], [], [ - #ifdef HAVE_SYS_TYPES_H - # include - #endif - #ifdef HAVE_SYS_TIME_H - # include - #endif - #ifdef HAVE_SYS_RESOURCE_H - # include - #endif - #ifdef HAVE_UNISTD_H - # include - #endif - #include -]) - AC_TYPE_SIZE_T RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include ]) RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include ]) diff --git a/process.c b/process.c index a216291595..51f3804f63 100644 --- a/process.c +++ b/process.c @@ -122,17 +122,6 @@ static VALUE rb_cProcessTms; #endif #endif -#if SIZEOF_RLIM_T == SIZEOF_INT -# define RLIM2NUM(v) UINT2NUM(v) -# define NUM2RLIM(v) NUM2UINT(v) -#elif SIZEOF_RLIM_T == SIZEOF_LONG -# define RLIM2NUM(v) ULONG2NUM(v) -# define NUM2RLIM(v) NUM2ULONG(v) -#elif SIZEOF_RLIM_T == SIZEOF_LONG_LONG -# define RLIM2NUM(v) ULL2NUM(v) -# define NUM2RLIM(v) NUM2ULL(v) -#endif - #define preserving_errno(stmts) \ do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)