summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2016-08-06 15:51:01 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2016-08-06 16:30:37 +0100
commit9960d1e59f08254a951283981d4a32c73ca7d3ad (patch)
tree6fd377616c2e8abf7500f0cb74b3f3564f989734 /src
parent44bc8f0c2f3576b46bd6df1b818cb29eaf84df5b (diff)
Fix DISABLE_DKIM build & test. Fix build on systems lacking MAX in standard includes.
Broken-by: 44bc8f0c2f35
Diffstat (limited to 'src')
-rw-r--r--src/src/macros.h5
-rw-r--r--src/src/smtp_in.c4
-rw-r--r--src/src/tls-gnu.c4
-rw-r--r--src/src/tls-openssl.c4
4 files changed, 11 insertions, 6 deletions
diff --git a/src/src/macros.h b/src/src/macros.h
index c62f16e7d..1b7cf4abf 100644
--- a/src/src/macros.h
+++ b/src/src/macros.h
@@ -15,6 +15,11 @@ a string as a text string. This is sometimes useful for debugging output. */
/* Number of elements of an array */
#define nelem(arr) (sizeof(arr) / sizeof(*arr))
+/* Maximum of two items */
+#ifndef MAX
+# define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
/* When running in the test harness, the load average is fudged. */
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index 8994c6edb..6c9afc501 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -352,15 +352,15 @@ if (smtp_inptr >= smtp_inend)
return *smtp_inptr++;
}
-#ifndef DISABLE_DKIM
void
smtp_get_cache(void)
{
+#ifndef DISABLE_DKIM
int n = smtp_inend - smtp_inptr;
if (n > 0)
dkim_exim_verify_feed(smtp_inptr, n);
-}
#endif
+}
/* Get a byte from the smtp input, in CHUNKING mode. Handle ack of the
diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c
index 0774850ca..c9dc4d9be 100644
--- a/src/src/tls-gnu.c
+++ b/src/src/tls-gnu.c
@@ -2219,16 +2219,16 @@ if (state->xfer_buffer_lwm >= state->xfer_buffer_hwm)
return state->xfer_buffer[state->xfer_buffer_lwm++];
}
-#ifndef DISABLE_DKIM
void
tls_get_cache()
{
+#ifndef DISABLE_DKIM
exim_gnutls_state_st * state = &state_server;
int n = state->xfer_buffer_hwm - state->xfer_buffer_lwm;
if (n > 0)
dkim_exim_verify_feed(state->xfer_buffer+state->xfer_buffer_lwm, n);
-}
#endif
+}
diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c
index 242394f95..229ea4131 100644
--- a/src/src/tls-openssl.c
+++ b/src/src/tls-openssl.c
@@ -2360,15 +2360,15 @@ if (ssl_xfer_buffer_lwm >= ssl_xfer_buffer_hwm)
return ssl_xfer_buffer[ssl_xfer_buffer_lwm++];
}
-#ifndef DISABLE_DKIM
void
tls_get_cache()
{
+#ifndef DISABLE_DKIM
int n = ssl_xfer_buffer_hwm - ssl_xfer_buffer_lwm;
if (n > 0)
dkim_exim_verify_feed(ssl_xfer_buffer+ssl_xfer_buffer_lwm, n);
-}
#endif
+}