From 0524b56bf6fb7229e173900a9f9355272d972e4b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 2 Apr 2014 07:57:38 +0200 Subject: [PATCH] Use _DEFAULT_SOURCE where _BSD_SOURCE macro presents glib-2.20 will deprecate _SVID_SOURCE and _BSD_SOURCE in favor of _DEFAULT_SOURCE. We need to define both of them to be compatible with glibc-2.20 as well older versions or other standard libraries. --- test/simline/basic_authentication.c | 5 ++++- test/simline/certificate_user_password_authentication.c | 5 ++++- test/simline/hotp_authentication.c | 5 ++++- test/simline/hotp_isds_change_password.c | 5 ++++- test/simline/isds_change_password.c | 5 ++++- test/simline/isds_delete_message_from_storage.c | 5 ++++- test/simline/isds_get_commercial_credit.c | 5 ++++- test/simline/isds_resign_message.c | 5 ++++- test/simline/server.c | 5 ++++- test/simline/totp_authentication.c | 5 ++++- test/simline/totp_isds_change_password.c | 5 ++++- 11 files changed, 44 insertions(+), 11 deletions(-) diff --git a/test/simline/basic_authentication.c b/test/simline/basic_authentication.c index 67bc1e4..29c05a3 100644 --- a/test/simline/basic_authentication.c +++ b/test/simline/basic_authentication.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST up to glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #ifndef _XOPEN_SOURCE diff --git a/test/simline/certificate_user_password_authentication.c b/test/simline/certificate_user_password_authentication.c index f328509..8c453d8 100644 --- a/test/simline/certificate_user_password_authentication.c +++ b/test/simline/certificate_user_password_authentication.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST up to glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #ifndef _XOPEN_SOURCE diff --git a/test/simline/hotp_authentication.c b/test/simline/hotp_authentication.c index 6d65ab8..2933bb6 100644 --- a/test/simline/hotp_authentication.c +++ b/test/simline/hotp_authentication.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST up to glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #ifndef _XOPEN_SOURCE diff --git a/test/simline/hotp_isds_change_password.c b/test/simline/hotp_isds_change_password.c index ae80276..95def10 100644 --- a/test/simline/hotp_isds_change_password.c +++ b/test/simline/hotp_isds_change_password.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST since glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #ifndef _XOPEN_SOURCE diff --git a/test/simline/isds_change_password.c b/test/simline/isds_change_password.c index 3bec5e2..879a413 100644 --- a/test/simline/isds_change_password.c +++ b/test/simline/isds_change_password.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST up to glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #ifndef _XOPEN_SOURCE diff --git a/test/simline/isds_delete_message_from_storage.c b/test/simline/isds_delete_message_from_storage.c index 29bc978..eb0aa22 100644 --- a/test/simline/isds_delete_message_from_storage.c +++ b/test/simline/isds_delete_message_from_storage.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST up to glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #ifndef _XOPEN_SOURCE diff --git a/test/simline/isds_get_commercial_credit.c b/test/simline/isds_get_commercial_credit.c index 96eee81..ead4f63 100644 --- a/test/simline/isds_get_commercial_credit.c +++ b/test/simline/isds_get_commercial_credit.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST up to glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #ifndef _XOPEN_SOURCE diff --git a/test/simline/isds_resign_message.c b/test/simline/isds_resign_message.c index 3c3573e..82306cd 100644 --- a/test/simline/isds_resign_message.c +++ b/test/simline/isds_resign_message.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST up to glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #ifndef _XOPEN_SOURCE diff --git a/test/simline/server.c b/test/simline/server.c index ed707dc..be7c02e 100644 --- a/test/simline/server.c +++ b/test/simline/server.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST up to glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #include "../test-tools.h" diff --git a/test/simline/totp_authentication.c b/test/simline/totp_authentication.c index 0020a84..237b736 100644 --- a/test/simline/totp_authentication.c +++ b/test/simline/totp_authentication.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST up to glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #ifndef _XOPEN_SOURCE diff --git a/test/simline/totp_isds_change_password.c b/test/simline/totp_isds_change_password.c index 2dda1c1..aabcca9 100644 --- a/test/simline/totp_isds_change_password.c +++ b/test/simline/totp_isds_change_password.c @@ -3,7 +3,10 @@ #endif #ifndef _BSD_SOURCE -#define _BSD_SOURCE /* For NI_MAXHOST */ +#define _BSD_SOURCE /* For NI_MAXHOST up to glibc-2.19 */ +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* For NI_MAXHOST since glibc-2.20 */ #endif #ifndef _XOPEN_SOURCE -- 2.11.4.GIT