]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
One way or another, whether we leave the casts in or out, right now we are
authorColm MacCarthaigh <colm@apache.org>
Tue, 4 Oct 2005 16:18:24 +0000 (16:18 +0000)
committerColm MacCarthaigh <colm@apache.org>
Tue, 4 Oct 2005 16:18:24 +0000 (16:18 +0000)
using "void *" containers to store long integers; Add a configure-time check to
ensure that it is valid to assume that a "void *" container is large enough to
store a long int. See <200510031150.j93Boh700945@devsys.jaguNET.com> and
ensuing discussion on httpd-dev.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@294809 13f79535-47bb-0310-9956-ffa450edef68

acinclude.m4
configure.in

index 0998bf9f6bd173c482e4f8bbb4ed32f984032484..313d7150d6d3f9ca32a373f614d1d99b9b3b34e9 100644 (file)
@@ -570,3 +570,24 @@ undefine([ap_ckver_minor])
 undefine([ap_ckver_cvar])
 undefine([ap_ckver_name])
 ])
+
+dnl
+dnl APACHE_CHECK_VOID_PTR_LEN
+dnl
+dnl Checks if the size of a void pointer is at least as big as a "long" 
+dnl integer type.
+dnl
+AC_DEFUN([APACHE_CHECK_VOID_PTR_LEN], [
+
+AC_CACHE_CHECK([for void pointer length], [ap_void_ptr_lt_long],
+[AC_TRY_RUN([
+int main(void)
+{
+    return sizeof(void *) < sizeof(long); 
+}], [ap_void_ptr_lt_long=yes], [ap_void_ptr_lt_long=no], 
+    [ap_void_ptr_lt_long=no])])
+
+if test "$ap_void_ptr_lt_long" = "no"; then
+    AC_MSG_ERROR([Size of "void *" is less than size of "long"])
+fi
+])
index 902bb1331762a6d5ba70cd3ebf1af9781048a00b..63aff0812371ee0fad1d45439599482b89cce19a 100644 (file)
@@ -32,6 +32,9 @@ APR_PARSE_ARGUMENTS
 dnl export expanded and relative configure argument variables
 APACHE_EXPORT_ARGUMENTS
 
+dnl confirm that a void pointer is large enough to store a long integer
+APACHE_CHECK_VOID_PTR_LEN
+
 dnl Save user-defined environment settings for later restoration
 dnl
 APR_SAVE_THE_ENVIRONMENT(CPPFLAGS)