]> granicus.if.org Git - apache/commitdiff
mod_crypto: improve error message with older APRs
authorJacob Champion <jchampion@apache.org>
Tue, 31 Jan 2017 18:56:33 +0000 (18:56 +0000)
committerJacob Champion <jchampion@apache.org>
Tue, 31 Jan 2017 18:56:33 +0000 (18:56 +0000)
When compiling against APR < 1.6, the actual error message was buried in
unknown type errors from mod_crypto.h. Don't include that file at all if
we're going to error out anyway.

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

modules/filters/mod_crypto.c

index 38c1177ae9178d5a6450667a86604733045d1c61..2c98692c4160f215e92525513f00e4fc7dba877b 100644 (file)
  *                  stacks.
  */
 
+#include "apr_version.h"
+#if !APR_VERSION_AT_LEAST(2,0,0)
+#include "apu_version.h"
+#endif
+
+#if !APR_VERSION_AT_LEAST(2,0,0) && \
+    !(APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 6)
+#error This module requires at least v1.6.0 of apr-util.
+#else
+
 #include "mod_crypto.h"
 #include "apr_lib.h"
 #include "apr_strings.h"
 #include "apr_crypto.h"
 #include "apr_base64.h"
 #include "apr_escape.h"
-#include "apr_version.h"
-#if !APR_VERSION_AT_LEAST(2,0,0)
-#include "apu_version.h"
-#endif
 #include "util_filter.h"
 #include "http_log.h"
 #include "http_request.h"
 #include "http_protocol.h"
 #include "ap_expr.h"
 
-#if APR_VERSION_AT_LEAST(2,0,0) || \
-    (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 6)
-
 APR_HOOK_STRUCT(APR_HOOK_LINK(crypto_key)
                 APR_HOOK_LINK(crypto_iv))
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap, CRYPTO, apr_status_t, crypto_key,
@@ -1308,6 +1311,4 @@ AP_DECLARE_MODULE(crypto) = {
     register_hooks            /* register hooks */
 };
 
-#else
-#error This module requires at least v1.6.0 of apr-util.
 #endif