summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2017-09-06 15:24:10 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2017-09-06 15:24:10 +0900
commit87473cd29ca9d5e3fb1c3172126c1122472d8b90 (patch)
treeefc719ebfd029f6bb990a7246a75e36c1decc5f4
parent859f9a9754708572a6289853d7d95b9ee3eae589 (diff)
downloadlibassuan-87473cd29ca9d5e3fb1c3172126c1122472d8b90.tar.gz
Define INADDR_LOOPBACK if not defined.
* src/assuan-socket.c (INADDR_LOOPBACK): Define. -- INADDR_LOOPBACK is not defined in some systems. When defined, its byte-order is not clearly defined in any specifications. So, best portable way is not to use the macro INADDR_LOOPBACK at all but use 0x7f000001 directly. Nevertheless, for systems which use libassuan, it's host byte-order. So, adding the definition works. GnuPG-bug-id: 2447 Suggested-by: Peter Dyballa Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--src/assuan-socket.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/assuan-socket.c b/src/assuan-socket.c
index d7616ce..6131e5b 100644
--- a/src/assuan-socket.c
+++ b/src/assuan-socket.c
@@ -107,6 +107,11 @@
#endif
+#ifndef INADDR_LOOPBACK
+# define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) /* 127.0.0.1. */
+#endif
+
+
/* The standard SOCKS and TOR port. */
#define SOCKS_PORT 1080
#define TOR_PORT 9050