mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* configure.in (int8_t, uint8_t, int16_t, uint16_t int32_t,
uint32_t int64_t, uint64_t, int128_t, uint128_t, intptr_t, uintptr_t): check if defined. * win32/Makefile.sub: follow configure.in. * ext/digest/defs.h: remove checks for uint8_t, uint32_t and uint64_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4b31c84dae
commit
668af7e99d
4 changed files with 67 additions and 25 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Fri Mar 14 10:37:15 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* configure.in (int8_t, uint8_t, int16_t, uint16_t int32_t,
|
||||
uint32_t int64_t, uint64_t, int128_t, uint128_t,
|
||||
intptr_t, uintptr_t): check if defined.
|
||||
|
||||
* win32/Makefile.sub: follow configure.in.
|
||||
|
||||
* ext/digest/defs.h: remove checks for uint8_t, uint32_t and uint64_t.
|
||||
|
||||
Fri Mar 14 10:12:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in (RUBY_CHECK_VARTYPE): should not indent preprocessor
|
||||
|
|
43
configure.in
43
configure.in
|
@ -620,18 +620,39 @@ AC_CHECK_TYPES(struct timespec)
|
|||
|
||||
AC_CHECK_TYPE(fd_mask, [AC_DEFINE(HAVE_RB_FD_INIT, 1)])
|
||||
|
||||
test ${rb_cv_type_uint32_t+set} && ac_cv_type_uint32_t=yes
|
||||
AC_CHECK_TYPE(uint32_t)
|
||||
if test ${ac_cv_type_uint32_t} != yes; then
|
||||
AC_CACHE_CHECK([unsigned 32bit int],
|
||||
rb_cv_type_uint32_t,
|
||||
[for type in short int long; do
|
||||
type="unsigned $type"
|
||||
AC_COMPILE_IFELSE(AC_LANG_BOOL_COMPILE_TRY([], [sizeof($type) == 4]),
|
||||
[rb_cv_type_uint32_t=$type; break], [])
|
||||
done])
|
||||
AC_DEFINE_UNQUOTED(uint32_t, $rb_cv_type_uint32_t)
|
||||
dnl RUBY_DEFINT [typename] [size] [signed]
|
||||
AC_DEFUN([RUBY_DEFINT], [dnl
|
||||
AC_CACHE_CHECK([for $1], [rb_cv_type_$1],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])
|
||||
typedef $1 t; int s = sizeof(t) == 42;])],
|
||||
[rb_cv_type_$1=yes],
|
||||
[case m4_bmatch([$2], [^[1-9][0-9]*$], $2, [$ac_cv_sizeof_]AS_TR_SH($2)) in
|
||||
"1") rb_cv_type_$1="m4_if([$3], [], [signed ], [$3 ])char";;
|
||||
"$ac_cv_sizeof_short") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])short";;
|
||||
"$ac_cv_sizeof_int") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])int";;
|
||||
"$ac_cv_sizeof_long") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long";;
|
||||
"$ac_cv_sizeof_long_long") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long long";;
|
||||
"$ac_cv_sizeof___int64") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int64";;
|
||||
*) rb_cv_type_$1=no;;
|
||||
esac])])
|
||||
if test "${rb_cv_type_$1}" != no; then
|
||||
AC_DEFINE([HAVE_]AS_TR_CPP($1), 1)
|
||||
test "${rb_cv_type_$1}" = yes || AC_DEFINE_UNQUOTED($1, [$rb_cv_type_$1])
|
||||
fi
|
||||
])
|
||||
|
||||
RUBY_DEFINT(int8_t, 1)
|
||||
RUBY_DEFINT(uint8_t, 1, unsigned)
|
||||
RUBY_DEFINT(int16_t, 2)
|
||||
RUBY_DEFINT(uint16_t, 2, unsigned)
|
||||
RUBY_DEFINT(int32_t, 4)
|
||||
RUBY_DEFINT(uint32_t, 4, unsigned)
|
||||
RUBY_DEFINT(int64_t, 8)
|
||||
RUBY_DEFINT(uint64_t, 8, unsigned)
|
||||
RUBY_DEFINT(int128_t, 16)
|
||||
RUBY_DEFINT(uint128_t, 16, unsigned)
|
||||
RUBY_DEFINT(intptr_t, void*)
|
||||
RUBY_DEFINT(uintptr_t, void*, unsigned)
|
||||
|
||||
AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
|
||||
[rb_cv_stack_end_address=no
|
||||
|
|
|
@ -16,18 +16,4 @@
|
|||
# define __END_DECLS
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_INTTYPES_H)
|
||||
# include <inttypes.h>
|
||||
#elif !defined __CYGWIN__ || !defined __uint8_t_defined
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned int uint32_t;
|
||||
# if SIZEOF_LONG == 8
|
||||
typedef unsigned long uint64_t;
|
||||
# elif SIZEOF_LONG_LONG == 8
|
||||
typedef unsigned LONG_LONG uint64_t;
|
||||
# else
|
||||
# define NO_UINT64_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* DEFS_H */
|
||||
|
|
|
@ -368,6 +368,31 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
|
|||
#define uint32_t unsigned int
|
||||
#define HAVE_STRUCT_STAT_ST_RDEV 1
|
||||
#define HAVE_ST_RDEV 1
|
||||
#define int8_t signed char
|
||||
#define HAVE_UINT8_T 1
|
||||
#define uint8_t unsigned char
|
||||
#define HAVE_INT16_T 1
|
||||
#define int16_t short
|
||||
#define HAVE_UINT16_T 1
|
||||
#define uint16_t unsigned short
|
||||
#define HAVE_INT32_T 1
|
||||
#define int32_t int
|
||||
#define HAVE_UINT32_T 1
|
||||
#define uint32_t unsigned int
|
||||
#define HAVE_INT64_T HAVE_LONG_LONG
|
||||
#define int64_t __int64
|
||||
#define HAVE_UINT64_T HAVE_LONG_LONG
|
||||
#define uint64_t unsigned __int64
|
||||
#define HAVE_INTPTR_T 1
|
||||
#define HAVE_UINTPTR_T 1
|
||||
!if "$(ARCH)" == "x64" || "$(ARCH)" == "ia64"
|
||||
#define intptr_t __int64
|
||||
#define uintptr_t unsigned __int64
|
||||
!else
|
||||
#define intptr_t long
|
||||
#define uintptr_t unsigned long
|
||||
!endif
|
||||
#endif
|
||||
#define GETGROUPS_T int
|
||||
#define RETSIGTYPE void
|
||||
!if !defined(WIN32_WCE)
|
||||
|
|
Loading…
Add table
Reference in a new issue