From: Sebastian Hahn Date: Wed, 16 Nov 2011 15:39:04 +0000 (+0100) Subject: Don't allow building on platforms where AF_UNSPEC != 0 X-Git-Tag: tor-0.2.3.8-alpha~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9fc7725aba8c623e2b35c4ceaee792d5f354912f;p=thirdparty%2Ftor.git Don't allow building on platforms where AF_UNSPEC != 0 --- diff --git a/changes/af_unspec b/changes/af_unspec new file mode 100644 index 0000000000..19ef4b4ccf --- /dev/null +++ b/changes/af_unspec @@ -0,0 +1,4 @@ + o Minor features: + - Detect when we build on a platform that doesn't define AF_UNSPEC to 0. + We don't work there, so refuse to compile. + diff --git a/src/common/address.c b/src/common/address.c index 00d2d100b8..f40e428cce 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -52,6 +52,13 @@ #include #include +/* tor_addr_is_null() and maybe other functions rely on AF_UNSPEC being 0 to + * work correctly. Bail out here if we've found a platform where AF_UNSPEC + * isn't 0. */ +#if AF_UNSPEC != 0 +#error We rely on AF_UNSPEC being 0. Let us know about your platform, please! +#endif + /** Convert the tor_addr_t in a, with port in port, into a * sockaddr object in *sa_out of object size len. If not enough * room is available in sa_out, or on error, return 0. On success, return