diff --git a/bin/xbps-fbulk/main.c b/bin/xbps-fbulk/main.c index 4bd10b05..e54bea17 100644 --- a/bin/xbps-fbulk/main.c +++ b/bin/xbps-fbulk/main.c @@ -47,8 +47,6 @@ * Only one attempt is made to build any given package, no matter how many * other packages depend on it. */ -#define _DEFAULT_SOURCE -#define _BSD_SOURCE #include #include diff --git a/bin/xbps-query/search.c b/bin/xbps-query/search.c index bf1bac27..98bd4c1d 100644 --- a/bin/xbps-query/search.c +++ b/bin/xbps-query/search.c @@ -23,12 +23,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_STRCASESTR -# define _GNU_SOURCE /* for strcasestr(3) */ -#endif - -#include "compat.h" - #include #include #include diff --git a/bin/xbps-uchroot/main.c b/bin/xbps-uchroot/main.c index 410afe3b..fefa65a0 100644 --- a/bin/xbps-uchroot/main.c +++ b/bin/xbps-uchroot/main.c @@ -32,28 +32,28 @@ * - Supports overlayfs on a temporary directory or a tmpfs mount. * - Supports read-only bind mounts. */ -#define _GNU_SOURCE -#define _XOPEN_SOURCE 700 -#include -#include + #include #include +#include #include +#include #include -#include -#include -#include -#include -#include -#include + #include -#include -#include -#include /* PATH_MAX */ +#include +#include +#include #include -#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include "queue.h" diff --git a/bin/xbps-uunshare/main.c b/bin/xbps-uunshare/main.c index ac257d38..8e0f5a27 100644 --- a/bin/xbps-uunshare/main.c +++ b/bin/xbps-uunshare/main.c @@ -22,25 +22,26 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define _GNU_SOURCE -#include -#include + #include +#include +#include #include + +#include +#include +#include +#include +#include +#include #include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include #include "queue.h" diff --git a/configure b/configure index 516a32ba..b5fce521 100755 --- a/configure +++ b/configure @@ -219,9 +219,10 @@ if [ -n "$FULL_DEBUG" ]; then echo "CPPFLAGS+= -DFULL_DEBUG" >>$CONFIG_MK fi +echo "CPPFLAGS += -D_DEFAULT_SOURCE" >>$CONFIG_MK +echo "CPPFLAGS += -D_GNU_SOURCE" >>$CONFIG_MK case "$OS" in linux) - echo "CPPFLAGS += -D_XOPEN_SOURCE=700" >>$CONFIG_MK echo "CPPFLAGS += -D_FILE_OFFSET_BITS=64" >> $CONFIG_MK ;; *) diff --git a/lib/cb_util.c b/lib/cb_util.c index 1aa0f073..35fbaa77 100644 --- a/lib/cb_util.c +++ b/lib/cb_util.c @@ -23,10 +23,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_VASPRINTF -# define _GNU_SOURCE /* for vasprintf(3) */ -#endif - #include #include #include diff --git a/lib/external/dewey.c b/lib/external/dewey.c index 80977d9c..033d2c15 100644 --- a/lib/external/dewey.c +++ b/lib/external/dewey.c @@ -31,9 +31,7 @@ #include #include #include -#define _BSD_SOURCE #include -#undef _BSD_SOURCE #include #include diff --git a/lib/external/fexec.c b/lib/external/fexec.c index 11c40120..8de8ad03 100644 --- a/lib/external/fexec.c +++ b/lib/external/fexec.c @@ -27,19 +27,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#define _BSD_SOURCE /* for vfork and chroot */ -#define _DEFAULT_SOURCE /* glibc>=2.20 */ #include -#include - #include + #include #include #include #include +#include -#undef _DEFAULT_SOURCE -#undef _BSD_SOURCE #include "xbps_api_impl.h" static int diff --git a/lib/fetch/ftp.c b/lib/fetch/ftp.c index 28296a00..9986a57e 100644 --- a/lib/fetch/ftp.c +++ b/lib/fetch/ftp.c @@ -57,11 +57,6 @@ * */ -#ifdef __linux__ -/* Keep this down to Linux, it can create surprises else where. */ -#define _GNU_SOURCE -#endif - #include #include diff --git a/lib/fetch/http.c b/lib/fetch/http.c index 0165de32..e0832865 100644 --- a/lib/fetch/http.c +++ b/lib/fetch/http.c @@ -62,10 +62,6 @@ * SUCH DAMAGE. */ -#if defined(__linux__) -#define _GNU_SOURCE -#endif - #include #include diff --git a/lib/portableproplib/prop_object.c b/lib/portableproplib/prop_object.c index 2e2a7c9d..daac88cf 100644 --- a/lib/portableproplib/prop_object.c +++ b/lib/portableproplib/prop_object.c @@ -36,9 +36,7 @@ static pthread_mutex_t _prop_refcnt_mtx = PTHREAD_MUTEX_INITIALIZER; #endif /* _PROP_NEED_REFCNT_MTX */ -#define __USE_MISC /* MAP_ANON on glibc */ -# include -#undef __USE_MISC +#include #include #include #include diff --git a/lib/util.c b/lib/util.c index 2e29d4d5..d5722ef4 100644 --- a/lib/util.c +++ b/lib/util.c @@ -22,17 +22,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#ifdef HAVE_VASPRINTF -# define _GNU_SOURCE /* for vasprintf(3) */ -#endif - -#if defined(HAVE_STRLCAT) || defined(HAVE_STRLCPY) -# define _BSD_SOURCE -#endif - -#include "compat.h" - #include #include @@ -47,6 +36,7 @@ #include #include +#include "compat.h" #include "xbps_api_impl.h" #ifdef __clang__