From bab298086b6626f3518f2e47289359e42e8c7697 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Mon, 3 Dec 2012 21:15:24 +0000 Subject: Fix build with clang, by: - setting USE_CSTD=gnu89 - unnesting a nested function definition (patch-src__util.c) Note that this code may be unsafe or yield bogus results where the sizes of size_t/int or long/int do not match, such as amd64. This causes tons of warnings with clang and should be reasonably easy to find. Feature safe: yes --- mail/smtp-gated/files/patch-src__util.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 mail/smtp-gated/files/patch-src__util.c (limited to 'mail') diff --git a/mail/smtp-gated/files/patch-src__util.c b/mail/smtp-gated/files/patch-src__util.c new file mode 100644 index 000000000000..073c72b8d9a0 --- /dev/null +++ b/mail/smtp-gated/files/patch-src__util.c @@ -0,0 +1,23 @@ +--- ./src/util.c.orig 2012-12-03 22:11:37.000000000 +0100 ++++ ./src/util.c 2012-12-03 22:11:44.000000000 +0100 +@@ -966,16 +966,16 @@ + } /* set_rlimit() */ + #endif + +-/* netmask(28) => 255.255.255.240 (network order) */ +-u_int32_t netmask(int m) +-{ +- inline u_int32_t power(u_int32_t x, u_int32_t y) ++static inline u_int32_t power(u_int32_t x, u_int32_t y) + { + u_int32_t r = 1; + while (y--) r*=x; + return r; + } + ++/* netmask(28) => 255.255.255.240 (network order) */ ++u_int32_t netmask(int m) ++{ + if (m < 0) + m = 0; + -- cgit v1.2.3