summaryrefslogtreecommitdiff
path: root/lib/gai_strerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gai_strerror.c')
-rw-r--r--lib/gai_strerror.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/gai_strerror.c b/lib/gai_strerror.c
index 92b4dd054..cc6f9c062 100644
--- a/lib/gai_strerror.c
+++ b/lib/gai_strerror.c
@@ -32,6 +32,22 @@
# define N_(String) String
#endif
+#if HAVE_DECL_GAI_STRERROR
+
+# include <sys/socket.h>
+# undef gai_strerror
+# if HAVE_DECL_GAI_STRERRORA
+# define gai_strerror gai_strerrorA
+# endif
+
+const char *
+rpl_gai_strerror (int code)
+{
+ return gai_strerror (code);
+}
+
+#else /* !HAVE_DECL_GAI_STRERROR */
+
static struct
{
int code;
@@ -71,6 +87,7 @@ gai_strerror (int code)
return _("Unknown error");
}
-#ifdef _LIBC
+# ifdef _LIBC
libc_hidden_def (gai_strerror)
-#endif
+# endif
+#endif /* !HAVE_DECL_GAI_STRERROR */