Ensure that _GNU_SOURCE is defined for NI_MAXHOST and NI_MAXSERV
authordrgler <daniel.kruegler@gmail.com>
Thu, 1 Oct 2020 19:20:33 +0000 (21:20 +0200)
committerDr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com>
Sat, 3 Oct 2020 14:01:53 +0000 (16:01 +0200)
Since glibc 2.8, these defines like `NI_MAXHOST` are exposed only
if suitable feature test macros are defined, namely: _GNU_SOURCE,
_DEFAULT_SOURCE (since glibc 2.19), or _BSD_SOURCE or _SVID_SOURCE
(before glibc 2.19), see GETNAMEINFO(3).

CLA: trivial
Fixes #13049

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/13054)

crypto/bio/b_addr.c

index 4652003149287ff94d19b1c3ac9f767acd3e5528..b7469bc720212ca776cd792c139ef3907823727b 100644 (file)
@@ -7,6 +7,10 @@
  * https://www.openssl.org/source/license.html
  */
 
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
+
 #include <assert.h>
 #include <string.h>