diff --git a/src/include/switch.h b/src/include/switch.h index c8a15a396d..d72de701e0 100644 --- a/src/include/switch.h +++ b/src/include/switch.h @@ -59,9 +59,19 @@ #define _XOPEN_SOURCE 600 #endif #endif +#ifdef __linux__ +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#endif #ifndef __BSD_VISIBLE #define __BSD_VISIBLE 1 #endif +#ifdef __linux__ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#endif #endif #include #include diff --git a/src/switch_apr.c b/src/switch_apr.c index f3409f25eb..55ddea5cd0 100644 --- a/src/switch_apr.c +++ b/src/switch_apr.c @@ -30,12 +30,6 @@ * */ -#ifdef __linux__ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#endif - #include #ifndef WIN32 #include diff --git a/src/switch_core.c b/src/switch_core.c index ecfe75cce5..54805839b2 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -34,9 +34,6 @@ */ -#ifdef __linux__ -#define _BSD_SOURCE -#endif #include #include