]> www.infradead.org Git - mtd-utils.git/commitdiff
move _GNU_SOURCE to the main makefile
authorMike Frysinger <vapier@gentoo.org>
Wed, 8 May 2013 16:27:24 +0000 (12:27 -0400)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 1 Jul 2013 05:55:49 +0000 (08:55 +0300)
A bunch of utils are relying on _GNU_SOURCE already.  The new prompt code
uses getline() which is now part of POSIX, but in older versions of glibc,
it was behind _GNU_SOURCE as it was a GNU extension.

This change doesn't actually tie us to glibc.  Only code that uses GNU
extensions does that.  It just kills warning when using older versions of
glibc.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Makefile
include/xalloc.h
mkfs.jffs2.c
mkfs.ubifs/mkfs.ubifs.h
nanddump.c
nandtest.c
nandwrite.c

index c8d25f26bb4f5ab46d1ed532b9e6c589cf7f7d09..bf57a13ac63233f3618475de842b46ff4fcc0d26 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 
 VERSION = 1.5.0
 
-CPPFLAGS += -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
+CPPFLAGS += -D_GNU_SOURCE -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
 
 ifeq ($(WITHOUT_XATTR), 1)
   CPPFLAGS += -DWITHOUT_XATTR
index f1cc8d4a1ab7fe5f689a037c9480762f3882e69d..532b80ff17a4e482c296cc31b6d3e9ec4908e897 100644 (file)
@@ -27,6 +27,7 @@
 #ifndef __MTD_UTILS_XALLOC_H__
 #define __MTD_UTILS_XALLOC_H__
 
+#include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -84,7 +85,6 @@ static char *xstrdup(const char *s)
 }
 
 #ifdef _GNU_SOURCE
-#include <stdarg.h>
 
 __attribute__((unused))
 static int xasprintf(char **strp, const char *fmt, ...)
index 7ade078be62b078d03cf2a5c5e65a3f105249596..c1b0f0df11f056354f3f2dd0bfbbc9e26a139cb1 100644 (file)
@@ -49,7 +49,6 @@
 
 #define PROGRAM_NAME "mkfs.jffs2"
 
-#define _GNU_SOURCE
 #include <sys/types.h>
 #include <stdio.h>
 #include <sys/stat.h>
index 01161ef2ca9d1188ac098728720e555d6392a502..6030c481e64083a1a824f09afacc5818faeaef02 100644 (file)
@@ -23,8 +23,6 @@
 #ifndef __MKFS_UBIFS_H__
 #define __MKFS_UBIFS_H__
 
-#define _GNU_SOURCE
-#define _LARGEFILE64_SOURCE
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
index be458c62eec9d2d7bb2aa60169be961fd01e0267..85ccd5d951ed6a740ccb0c666c0942ed2f322def 100644 (file)
@@ -15,7 +15,6 @@
 
 #define PROGRAM_NAME "nanddump"
 
-#define _GNU_SOURCE
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
index 0187b877e713669363a38cc1ae9c2679978ae889..3437b57eee4943df3c5e052436d1991a6a6d5f36 100644 (file)
@@ -1,6 +1,5 @@
 #define PROGRAM_NAME "nandtest"
 
-#define _GNU_SOURCE
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
index de8e7d2aee11a9b3ae72b02204583c42de14b9fb..a6b6581c472641a6833409eb5396e89169f99e26 100644 (file)
@@ -21,7 +21,6 @@
 
 #define PROGRAM_NAME "nandwrite"
 
-#define _GNU_SOURCE
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>