Skip to content

Commit 48c9879

Browse files
committed
lib,bin: cleanup _{GNU,BSD,DEFAULT}_SOURCE, this shouldn't be per file
1 parent b75e151 commit 48c9879

File tree

12 files changed

+2
-40
lines changed

12 files changed

+2
-40
lines changed

bin/xbps-fbulk/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
* Only one attempt is made to build any given package, no matter how many
4848
* other packages depend on it.
4949
*/
50-
#define _DEFAULT_SOURCE
51-
#define _BSD_SOURCE
5250
#include <stdio.h>
5351
#include <stdlib.h>
5452
#include <unistd.h>

bin/xbps-query/search.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2424
*/
2525

26-
#ifdef HAVE_STRCASESTR
27-
# define _GNU_SOURCE /* for strcasestr(3) */
28-
#endif
29-
3026
#include "compat.h"
3127

3228
#include <stdio.h>

bin/xbps-uchroot/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
* - Supports overlayfs on a temporary directory or a tmpfs mount.
3333
* - Supports read-only bind mounts.
3434
*/
35-
#define _GNU_SOURCE
36-
#define _XOPEN_SOURCE 700
3735
#include <sys/types.h>
3836
#include <sys/prctl.h>
3937
#include <sys/fsuid.h>

bin/xbps-uunshare/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2323
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2424
*/
25-
#define _GNU_SOURCE
2625
#include <sys/types.h>
2726
#include <sys/mount.h>
2827
#include <sys/fsuid.h>

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ echo "CC = $CC" >>$CONFIG_MK
195195
echo "CFLAGS = -O2" >>$CONFIG_MK
196196

197197
echo "LDFLAGS = -L\$(TOPDIR)/lib" >>$CONFIG_MK
198-
echo "CPPFLAGS = -I. -I\$(TOPDIR) -I\$(TOPDIR)/include" >>$CONFIG_MK
198+
echo "CPPFLAGS = -D_DEFAULT_SOURCE -D_GNU_SOURCE -I. -I\$(TOPDIR) -I\$(TOPDIR)/include" >>$CONFIG_MK
199199
echo "CPPFLAGS += -DXBPS_SYSCONF_PATH=\\\"${ETCDIR}\\\"" >>$CONFIG_MK
200200
echo "CPPFLAGS += -DXBPS_SYSDEFCONF_PATH=\\\"${SHAREDIR}/xbps.d\\\"" >>$CONFIG_MK
201201
echo "CPPFLAGS += -DXBPS_VERSION=\\\"${VERSION}\\\"" >>$CONFIG_MK

lib/cb_util.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2424
*/
2525

26-
#ifdef HAVE_VASPRINTF
27-
# define _GNU_SOURCE /* for vasprintf(3) */
28-
#endif
29-
3026
#include <stdio.h>
3127
#include <stdbool.h>
3228
#include <stdlib.h>

lib/external/dewey.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030

3131
#include <stdio.h>
3232
#include <stdlib.h>
33-
#define _BSD_SOURCE
3433
#include <string.h>
35-
#undef _BSD_SOURCE
3634
#include <strings.h>
3735
#include <ctype.h>
3836

lib/external/fexec.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
* POSSIBILITY OF SUCH DAMAGE.
2828
*/
2929

30-
#define _BSD_SOURCE /* for vfork and chroot */
31-
#define _DEFAULT_SOURCE /* glibc>=2.20 */
3230
#include <sys/types.h>
3331
#include <unistd.h>
3432

@@ -38,8 +36,6 @@
3836
#include <stdlib.h>
3937
#include <string.h>
4038

41-
#undef _DEFAULT_SOURCE
42-
#undef _BSD_SOURCE
4339
#include "xbps_api_impl.h"
4440

4541
static int

lib/fetch/ftp.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@
5757
*
5858
*/
5959

60-
#ifdef __linux__
61-
/* Keep this down to Linux, it can create surprises else where. */
62-
#define _GNU_SOURCE
63-
#endif
64-
6560
#include <sys/types.h>
6661
#include <sys/socket.h>
6762

lib/fetch/http.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@
6262
* SUCH DAMAGE.
6363
*/
6464

65-
#if defined(__linux__)
66-
#define _GNU_SOURCE
67-
#endif
68-
6965
#include <sys/types.h>
7066
#include <sys/socket.h>
7167

0 commit comments

Comments
 (0)