From: Colm MacCarthaigh Date: Tue, 4 Oct 2005 16:18:24 +0000 (+0000) Subject: One way or another, whether we leave the casts in or out, right now we are X-Git-Tag: 2.3.0~2915 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4674da2cc71a116b0277db071b069bf15342cfe8;p=thirdparty%2Fapache%2Fhttpd.git One way or another, whether we leave the casts in or out, right now we are 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 --- diff --git a/acinclude.m4 b/acinclude.m4 index 0998bf9f6bd..313d7150d6d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 +]) diff --git a/configure.in b/configure.in index 902bb133176..63aff081237 100644 --- a/configure.in +++ b/configure.in @@ -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)