Modernise use of AC_CHECK_TYPE
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Thu, 6 May 2010 14:00:00 +0000 (15:00 +0100)
committerDerrick Brashear <shadow@dementia.org>
Thu, 6 May 2010 19:23:22 +0000 (12:23 -0700)
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 <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

acinclude.m4
src/config/stds.h

index 152bdd4..7f656d0 100644 (file)
@@ -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 <signal.h> does not define.])],
+AC_CHECK_TYPES([ssize_t])
+AC_CHECK_TYPES([sig_atomic_t],[],[],
 [#include <sys/types.h>
 #include <signal.h>])
 AC_SIZEOF_TYPE(long)
index 403284c..a9d22f5 100644 (file)
@@ -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