summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2021-04-17 21:46:47 -0600
committerEduardo Chappa <chappa@washington.edu>2021-04-17 21:46:47 -0600
commitb13392840331b64dc6d6690012dd2715f1ac7510 (patch)
tree659005f73de6d966a7444b9ebce8084fadb7f6ba
parentf6519aa1448e62a757d43e57cabd081ab594dfb1 (diff)
downloadalpine-b13392840331b64dc6d6690012dd2715f1ac7510.tar.xz
NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE First use the commit command before using "git commit -a" NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE * Add new type SUINT32, as a shorter version of UINT32 for systems that do not have a proper uint32_t type. SUINT32 is defined by default to be UINT32, but during compilation the user can define an environment variable SUINT32 to be, say, unsigned long, and that will make SUINT32 to take that type. This, and the source codem, are the only places where this is documented. Work in collaboration with professor Martin Trusler.
-rwxr-xr-xconfigure10
-rw-r--r--configure.ac6
-rw-r--r--include/config.h.in3
-rw-r--r--include/config.wnt.h1
-rw-r--r--include/general.h4
-rw-r--r--pith/adrbklib.h5
6 files changed, 27 insertions, 2 deletions
diff --git a/configure b/configure
index ae038f5..de7219f 100755
--- a/configure
+++ b/configure
@@ -20834,6 +20834,16 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+if test -z "$SUINT32" ; then
+ SUINT32="$uint32"
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define SUINT32 $SUINT32
+_ACEOF
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking argument pointer type of qsort compare function and base" >&5
$as_echo_n "checking argument pointer type of qsort compare function and base... " >&6; }
if ${ac_cv_func_qsort_argtype+:} false; then :
diff --git a/configure.ac b/configure.ac
index 0c2d9c7..00421c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1935,6 +1935,12 @@ AC_CHECK_HEADERS([stdint.h], [uint32=uint32_t], [
])
AC_DEFINE_UNQUOTED([UINT32], $uint32, [System defined unsigned 32 bit integer])
+if test -z "$SUINT32" ; then
+ SUINT32="$uint32"
+fi
+
+AC_DEFINE_UNQUOTED([SUINT32], $SUINT32, [System defined for shorter than unsigned 32 bit integer])
+
AC_CACHE_CHECK(argument pointer type of qsort compare function and base,
ac_cv_func_qsort_argtype,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
diff --git a/include/config.h.in b/include/config.h.in
index 834950c..7d978e6 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -608,6 +608,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* System defined for shorter than unsigned 32 bit integer */
+#undef SUINT32
+
/* System pinerc */
#undef SYSTEM_PINERC
diff --git a/include/config.wnt.h b/include/config.wnt.h
index 156b34e..042f94a 100644
--- a/include/config.wnt.h
+++ b/include/config.wnt.h
@@ -589,6 +589,7 @@
/* System defined unsigned 32 bit integer */
/* #define UINT32 uint32_t */
/* #define UINT32 unsigned long */
+#define SUINT32 UINT32
/* Compile in quota check on startup */
/* #define USE_QUOTAS */
diff --git a/include/general.h b/include/general.h
index 0ae02f0..95d914a 100644
--- a/include/general.h
+++ b/include/general.h
@@ -122,8 +122,10 @@
* interfere with the actual character values. They are also
* all positive values with the most significant bit set to 0,
* so a 32 bit signed integer could hold them all.
+ * For most people SUINT32 is UINT32, but the user can define
+ * differently at compilation time, for example, as unsigned long.
*/
-typedef UINT32 UCS;
+typedef SUINT32 UCS;
/*
* The type of an IMAP UID, which is a 32-bit unsigned int.
diff --git a/pith/adrbklib.h b/pith/adrbklib.h
index b128ca7..1cc7402 100644
--- a/pith/adrbklib.h
+++ b/pith/adrbklib.h
@@ -118,9 +118,12 @@
* an unsigned long, too. If it is an unsigned int, then a_c_arg_t could
* be an unsigned int, too. However, if we just make it unsigned long, then
* it will be the same in all cases and big enough in all cases.
+ * For most people SUINT32 is UINT32, but users can define at configure stage
+ * that SUINT32 could be something different, by means of defining an environment
+ * variable SUINT32 as, say, unsigned long.
*/
-#define adrbk_cntr_t UINT32 /* addrbook counter type */
+#define adrbk_cntr_t SUINT32 /* addrbook counter type */
typedef unsigned long a_c_arg_t; /* type of arg passed for adrbk_cntr_t */
#define NO_NEXT ((adrbk_cntr_t)-1)
#define MAX_ADRBK_SIZE (2000000000L) /* leave room for extra display lines */