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>
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
#ifndef __MTD_UTILS_XALLOC_H__
#define __MTD_UTILS_XALLOC_H__
+#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
}
#ifdef _GNU_SOURCE
-#include <stdarg.h>
__attribute__((unused))
static int xasprintf(char **strp, const char *fmt, ...)
#define PROGRAM_NAME "mkfs.jffs2"
-#define _GNU_SOURCE
#include <sys/types.h>
#include <stdio.h>
#include <sys/stat.h>
#ifndef __MKFS_UBIFS_H__
#define __MKFS_UBIFS_H__
-#define _GNU_SOURCE
-#define _LARGEFILE64_SOURCE
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#define PROGRAM_NAME "nanddump"
-#define _GNU_SOURCE
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#define PROGRAM_NAME "nandtest"
-#define _GNU_SOURCE
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#define PROGRAM_NAME "nandwrite"
-#define _GNU_SOURCE
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>