From 07098dc6708472cf5624b368d63efbdef7d409b8 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Thu, 6 May 2010 15:00:00 +0100 Subject: [PATCH] Modernise use of AC_CHECK_TYPE Prior to autoconf 2.13, AC_CHECK_TYPE took two arguments, the type to check and the a default type to use if that type wasn't defined. This usage has been deprecated since 2.13, and the AC_CHECK_TYPE macro itself now behaves differently. Whilst there is a compatibility mode, the autoconf documentation discourages its use. We also have an occurence of a slightly more modern AC_CHECK_TYPE, where we explicitly #define a default value if one isn't provided. The autoconf manual also discourages this form, however, in favour of using AC_CHECK_TYPES, and placing suitable typedefs in an external header file. Modify our code so we do things in the recommended way. Change-Id: Ie28067f2c90e9a3aa25cfde45ef081da2d380ee1 Reviewed-on: http://gerrit.openafs.org/1914 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- acinclude.m4 | 6 ++---- src/config/stds.h | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 152bdd4ac8..7f656d09ff 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1274,10 +1274,8 @@ AC_CHECK_SIZEOF(unsigned long) AC_CHECK_SIZEOF(unsigned int) AC_TYPE_INTPTR_T AC_TYPE_UINTPTR_T -AC_CHECK_TYPE(ssize_t, int) -AC_CHECK_TYPE([sig_atomic_t], , - [AC_DEFINE([sig_atomic_t], [int], - [Define to int if does not define.])], +AC_CHECK_TYPES([ssize_t]) +AC_CHECK_TYPES([sig_atomic_t],[],[], [#include #include ]) AC_SIZEOF_TYPE(long) diff --git a/src/config/stds.h b/src/config/stds.h index 403284cc38..a9d22f530c 100644 --- a/src/config/stds.h +++ b/src/config/stds.h @@ -51,6 +51,14 @@ pragma Off(Prototype_override_warnings); #define MIN_AFS_INT64 (-MAX_AFS_INT64 - 1) #define MAX_AFS_UINT64 0xFFFFFFFFFFFFFFFFL +#ifndef HAVE_SSIZE_T +typedef int ssize_t; +#endif + +#ifndef HAVE_SIG_ATOMIC_T +typedef int sig_atomic_t; +#endif + typedef short afs_int16; typedef unsigned short afs_uint16; #ifdef AFS_64BIT_ENV