From 1e577b80169b1ffe4946b3fda8b2f3b22c1e7fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Thu, 15 Jul 1999 09:54:36 -0700 Subject: [PATCH] added better tests for type sizes Rev: src/acconfig.h:1.45 Rev: src/aclocal.m4:1.13 Rev: src/configure.in:1.303 Rev: src/global.h:1.36 --- src/acconfig.h | 17 ++++++++++++++++- src/aclocal.m4 | 29 ++++++++++++++++++++++++++++- src/configure.in | 17 ++++++++++------- src/global.h | 7 ++++++- 4 files changed, 60 insertions(+), 10 deletions(-) diff --git a/src/acconfig.h b/src/acconfig.h index 8e0d2bcb1e..940fa66156 100644 --- a/src/acconfig.h +++ b/src/acconfig.h @@ -1,5 +1,5 @@ /* - * $Id: acconfig.h,v 1.44 1999/07/08 23:24:23 hubbe Exp $ + * $Id: acconfig.h,v 1.45 1999/07/15 16:54:33 hubbe Exp $ */ #ifndef MACHINE_H #define MACHINE_H @@ -57,6 +57,21 @@ /* Define to 'short' if <sys/types.h> doesn't */ #undef pri_t +/* Define to 'int' if <sys/types.h> doesn't */ +#undef uid_t + +/* Define to 'int' if <sys/types.h> doesn't */ +#undef gid_t + +/* Define to 'int' if <sys/types.h> doesn't */ +#undef pid_t + +/* Define to 'long' if <sys/types.h> doesn't */ +#undef size_t + +/* Define to 'long' if <sys/types.h> doesn't */ +#undef off_t + /* Define to 'int' if <signal.h> doesn't */ #undef sig_atomic_t diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 7c6d5807d2..8a312fdd6a 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -43,6 +43,33 @@ pushdef([AC_CONFIG_HEADER], AC_CONFIG_HEADER($1) ]) +AC_DEFUN(AC_MY_CHECK_TYPE, +[ +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(ac_cv_type_$1, +[ +AC_TRY_COMPILE([ +#include <sys/types.h> + +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif + +],[ +$1 tmp; +],ac_cv_type_$1=yes,ac_cv_type_$1=no) +]) + +if test $ac_cv_type_$1 = no; then + AC_DEFINE($1,$2) + AC_MSG_RESULT(no) +else + AC_MSG_RESULT(yes) +fi +]) + + AC_DEFUN(AC_TRY_ASSEMBLE, [ac_c_ext=$ac_ext ac_ext=${ac_s_ext-s} @@ -67,7 +94,7 @@ rm -rf conftest*]) define([AC_LOW_MODULE_INIT], [ -# $Id: aclocal.m4,v 1.12 1999/05/30 20:52:29 grubba Exp $ +# $Id: aclocal.m4,v 1.13 1999/07/15 16:54:34 hubbe Exp $ MY_AC_PROG_CC diff --git a/src/configure.in b/src/configure.in index 2bd1bf44ed..4a895ab554 100644 --- a/src/configure.in +++ b/src/configure.in @@ -1,4 +1,4 @@ -AC_REVISION("$Id: configure.in,v 1.302 1999/07/08 23:04:40 hubbe Exp $") +AC_REVISION("$Id: configure.in,v 1.303 1999/07/15 16:54:35 hubbe Exp $") AC_INIT(interpret.c) AC_CONFIG_HEADER(machine.h) @@ -1083,7 +1083,7 @@ thread.h dlfcn.h dld.h dl.h sys/times.h sched.h sys/procfs.h sys/param.h \ winsock.h sys/ioct.h sys/socket.h malloc.h netinet/in.h sys/wait.h winbase.h \ grp.h pwd.h passwd.h group.h winsock2.h signal.h sys/file.h poll.h sys/poll.h \ socket.h ieeefp.h fp_class.h floatingpoint.h sys/priocntl.h sched.h \ -windows.h errno.h) +windows.h errno.h stddef.h) AC_CHECK_SIZEOF(char *,4) AC_CHECK_SIZEOF(long,4) @@ -1092,12 +1092,15 @@ AC_CHECK_SIZEOF(short,2) AC_CHECK_SIZEOF(float,4) AC_CHECK_SIZEOF(double,8) -AC_TYPE_SIZE_T -AC_TYPE_PID_T -AC_TYPE_UID_T +AC_MY_CHECK_TYPE(size_t,long) +AC_MY_CHECK_TYPE(off_t,long) +AC_MY_CHECK_TYPE(pid_t,int) +AC_MY_CHECK_TYPE(uid_t,int) +AC_MY_CHECK_TYPE(gid_t,int) +AC_MY_CHECK_TYPE(time_t,INT32) +AC_MY_CHECK_TYPE(pri_t, short) + AC_TYPE_SIGNAL -AC_CHECK_TYPE(time_t,INT32) -AC_CHECK_TYPE(pri_t, short) dnl AC_CHECK_LIB(PW, alloca) diff --git a/src/global.h b/src/global.h index fabd69fc32..598c3aadc0 100644 --- a/src/global.h +++ b/src/global.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: global.h,v 1.35 1999/06/19 20:00:09 hubbe Exp $ + * $Id: global.h,v 1.36 1999/07/15 16:54:36 hubbe Exp $ */ #ifndef GLOBAL_H #define GLOBAL_H @@ -113,6 +113,11 @@ char *alloca (); #undef HAVE_STDLIB_H #endif +#ifdef HAVE_STDLIB_H +#include <stddef.h> +#undef HAVE_STDLIB_H +#endif + #ifdef HAVE_MALLOC_H #include <malloc.h> #undef HAVE_MALLOC_H -- GitLab