]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't allow building on platforms where AF_UNSPEC != 0
authorSebastian Hahn <sebastian@torproject.org>
Wed, 16 Nov 2011 15:39:04 +0000 (16:39 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Wed, 16 Nov 2011 15:39:04 +0000 (16:39 +0100)
changes/af_unspec [new file with mode: 0644]
src/common/address.c

diff --git a/changes/af_unspec b/changes/af_unspec
new file mode 100644 (file)
index 0000000..19ef4b4
--- /dev/null
@@ -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.
+
index 00d2d100b84f44782fa3e4c109c532a8e5e518c5..f40e428cce0f4a2c0d40931ad486ce482252debf 100644 (file)
 #include <string.h>
 #include <assert.h>
 
+/* 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 <b>a</b>, with port in <b>port</b>, into a
  * sockaddr object in *<b>sa_out</b> of object size <b>len</b>.  If not enough
  * room is available in sa_out, or on error, return 0.  On success, return