chiark / gitweb /
Make IDN support conditional
authorWaldemar Brodkorb <wbx@openadk.org>
Thu, 15 Jun 2017 15:44:59 +0000 (17:44 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:52 +0000 (09:46 +0200)
[zj: rename HAVE_IDN to ENABLE_IDN]

src/basic/socket-util.c

index d392da2a48ab69217d7b67b8e963d7c5b02c8835..23e960e023fa19872fe27f3cf13ab289c7a6ebb3 100644 (file)
 #include "string-util.h"
 #include "strv.h"
 #include "user-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "user-util.h"
+//#include "utf8.h"
 #include "util.h"
 
 #if 0 /// UNNEEDED by elogind
 #include "util.h"
 
 #if 0 /// UNNEEDED by elogind
+#ifdef ENABLE_IDN
+#  define IDN_FLAGS (NI_IDN|NI_IDN_USE_STD3_ASCII_RULES)
+#else
+#  define IDN_FLAGS 0
+#endif
+
 int socket_address_parse(SocketAddress *a, const char *s) {
         char *e, *n;
         unsigned u;
 int socket_address_parse(SocketAddress *a, const char *s) {
         char *e, *n;
         unsigned u;
@@ -722,8 +729,7 @@ int socknameinfo_pretty(union sockaddr_union *sa, socklen_t salen, char **_ret)
 
         assert(_ret);
 
 
         assert(_ret);
 
-        r = getnameinfo(&sa->sa, salen, host, sizeof(host), NULL, 0,
-                        NI_IDN|NI_IDN_USE_STD3_ASCII_RULES);
+        r = getnameinfo(&sa->sa, salen, host, sizeof(host), NULL, 0, IDN_FLAGS);
         if (r != 0) {
                 int saved_errno = errno;
 
         if (r != 0) {
                 int saved_errno = errno;