From: Karel Zak <kzak@redhat.com>
To: linux-btrfs@vger.kernel.org
Cc: Karel Zak <kzak@redhat.com>
Subject: [PATCH 02/10] btrfs-progs: use config.h
Date: Fri, 12 Dec 2014 13:35:16 +0100 [thread overview]
Message-ID: <1418387724-20188-3-git-send-email-kzak@redhat.com> (raw)
In-Reply-To: <1418387724-20188-1-git-send-email-kzak@redhat.com>
- the header file is generated by ./configure, the standard autotools
way is to use -include config.h on compiler command line rather than
include the file directly from code
- remove _GNU_SOURCE from code, the macros is already defined in config.h
by AC_USE_SYSTEM_EXTENSIONS autoconf macro
Signed-off-by: Karel Zak <kzak@redhat.com>
---
Makefile.in | 4 +++-
btrfs-calc-size.c | 1 -
btrfs-convert.c | 1 -
btrfs-corrupt-block.c | 2 +-
btrfs-find-root.c | 2 +-
btrfs-fragments.c | 1 -
btrfs-image.c | 2 +-
btrfs-list.c | 1 -
btrfs-map-logical.c | 2 +-
btrfs-select-super.c | 2 +-
btrfs-show-super.c | 2 +-
btrfs-zero-log.c | 2 +-
btrfs.c | 1 -
btrfstune.c | 2 +-
chunk-recover.c | 1 -
cmds-check.c | 2 +-
cmds-receive.c | 1 -
cmds-restore.c | 1 -
cmds-send.c | 2 --
disk-io.c | 2 +-
mkfs.c | 1 -
send-test.c | 2 --
super-recover.c | 1 -
utils-lib.c | 2 --
utils.c | 2 +-
25 files changed, 14 insertions(+), 28 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 4cae30c..0dd83ea 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -4,7 +4,9 @@ export
CC = gcc
LN = ln
AR = ar
-AM_CFLAGS = -Wall -D_FILE_OFFSET_BITS=64 -DBTRFS_FLAT_INCLUDES -fno-strict-aliasing -fPIC
+AM_CFLAGS = -include config.h -Wall \
+ -D_FILE_OFFSET_BITS=64 -DBTRFS_FLAT_INCLUDES \
+ -fno-strict-aliasing -fPIC
CFLAGS = -g -O1 -fno-strict-aliasing -rdynamic
objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
root-tree.o dir-item.o file-item.o inode-item.o inode-map.o \
diff --git a/btrfs-calc-size.c b/btrfs-calc-size.c
index 501111c..3ec8230 100644
--- a/btrfs-calc-size.c
+++ b/btrfs-calc-size.c
@@ -17,7 +17,6 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/btrfs-convert.c b/btrfs-convert.c
index 02c5e94..c88acc1 100644
--- a/btrfs-convert.c
+++ b/btrfs-convert.c
@@ -17,7 +17,6 @@
*/
#define _XOPEN_SOURCE 600
-#define _GNU_SOURCE 1
#include "kerncompat.h"
diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c
index af9ae4d..e993680 100644
--- a/btrfs-corrupt-block.c
+++ b/btrfs-corrupt-block.c
@@ -17,7 +17,7 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index 6fa61cc..b24dddf 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -17,7 +17,7 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/btrfs-fragments.c b/btrfs-fragments.c
index d03c2c3..ca45686 100644
--- a/btrfs-fragments.c
+++ b/btrfs-fragments.c
@@ -14,7 +14,6 @@
* Boston, MA 021110-1307, USA.
*/
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/btrfs-image.c b/btrfs-image.c
index cb17f16..1257966 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -17,7 +17,7 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
+
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/btrfs-list.c b/btrfs-list.c
index 50edcf4..3e29cf8 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -16,7 +16,6 @@
* Boston, MA 021110-1307, USA.
*/
-#define _GNU_SOURCE
#include <sys/ioctl.h>
#include <sys/mount.h>
#include "ioctl.h"
diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c
index 47d1104..c34484f 100644
--- a/btrfs-map-logical.c
+++ b/btrfs-map-logical.c
@@ -17,7 +17,7 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
diff --git a/btrfs-select-super.c b/btrfs-select-super.c
index 6231d42..54ac436 100644
--- a/btrfs-select-super.c
+++ b/btrfs-select-super.c
@@ -17,7 +17,7 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/btrfs-show-super.c b/btrfs-show-super.c
index 2b48f44..9702eb0 100644
--- a/btrfs-show-super.c
+++ b/btrfs-show-super.c
@@ -17,7 +17,7 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/btrfs-zero-log.c b/btrfs-zero-log.c
index 4154175..411fae3 100644
--- a/btrfs-zero-log.c
+++ b/btrfs-zero-log.c
@@ -17,7 +17,7 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/btrfs.c b/btrfs.c
index e83349c..2451885 100644
--- a/btrfs.c
+++ b/btrfs.c
@@ -14,7 +14,6 @@
* Boston, MA 021110-1307, USA.
*/
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/btrfstune.c b/btrfstune.c
index 050418a..899a721 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -17,7 +17,7 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
diff --git a/chunk-recover.c b/chunk-recover.c
index 6f43066..688a7d7 100644
--- a/chunk-recover.c
+++ b/chunk-recover.c
@@ -16,7 +16,6 @@
* Boston, MA 021110-1307, USA.
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdio_ext.h>
diff --git a/cmds-check.c b/cmds-check.c
index 9fc1410..0894cf0 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -17,7 +17,7 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/cmds-receive.c b/cmds-receive.c
index 358df1f..f234b15 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -16,7 +16,6 @@
* Boston, MA 021110-1307, USA.
*/
-#define _GNU_SOURCE
#define _POSIX_C_SOURCE 200809
#define _XOPEN_SOURCE 700
#define _BSD_SOURCE
diff --git a/cmds-restore.c b/cmds-restore.c
index 2f9b72d..a5c99e8 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -17,7 +17,6 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
#include "kerncompat.h"
diff --git a/cmds-send.c b/cmds-send.c
index b17b5e2..f6fae44 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -16,8 +16,6 @@
* Boston, MA 021110-1307, USA.
*/
-#define _GNU_SOURCE
-
#include "kerncompat.h"
#include <unistd.h>
diff --git a/disk-io.c b/disk-io.c
index 03edf8e..9f15c0c 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -18,7 +18,7 @@
#define _XOPEN_SOURCE 600
#define __USE_XOPEN2K
-#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
diff --git a/mkfs.c b/mkfs.c
index e10e62d..d5d03fc 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -17,7 +17,6 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE
#include "kerncompat.h"
diff --git a/send-test.c b/send-test.c
index 0e804a2..af8229e 100644
--- a/send-test.c
+++ b/send-test.c
@@ -21,8 +21,6 @@
* Boston, MA 021110-1307, USA.
*/
-#define _GNU_SOURCE
-
#include <unistd.h>
#include <stdint.h>
#include <dirent.h>
diff --git a/super-recover.c b/super-recover.c
index adb2c44..d0125f4 100644
--- a/super-recover.c
+++ b/super-recover.c
@@ -17,7 +17,6 @@
*/
#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
diff --git a/utils-lib.c b/utils-lib.c
index 9d53c6e..79ef35e 100644
--- a/utils-lib.c
+++ b/utils-lib.c
@@ -1,5 +1,3 @@
-#define _GNU_SOURCE
-
#include "kerncompat.h"
#include <unistd.h>
#include <stdlib.h>
diff --git a/utils.c b/utils.c
index 2a92416..1f95a9b 100644
--- a/utils.c
+++ b/utils.c
@@ -20,7 +20,7 @@
#define _XOPEN_SOURCE 700
#define __USE_XOPEN2K8
#define __XOPEN2K8 /* due to an error in dirent.h, to get dirfd() */
-#define _GNU_SOURCE /* O_NOATIME */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
--
1.9.3
next prev parent reply other threads:[~2014-12-12 12:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-12 12:35 btrfs-prog: improve build-system by autoconf Karel Zak
2014-12-12 12:35 ` [PATCH 01/10] btrfs-progs: add ./configure script Karel Zak
2014-12-12 12:35 ` Karel Zak [this message]
2014-12-12 12:35 ` [PATCH 03/10] btrfs-progs: use standard PACKAGE_* macros Karel Zak
2014-12-12 12:35 ` [PATCH 04/10] btrfs-progs: use ./configure to generate version.h Karel Zak
2014-12-12 12:35 ` [PATCH 05/10] btrfs-progs: check for build programs in ./configure Karel Zak
2014-12-12 12:35 ` [PATCH 06/10] btrfs-progs: use paths and $*_LIBS from ./configure Karel Zak
2014-12-12 12:35 ` [PATCH 07/10] btrfs-progs: cleanup compilation flags usage Karel Zak
2014-12-12 12:35 ` [PATCH 08/10] btrfs-progs: clean generated files, make version.h stuff more robust Karel Zak
2014-12-12 12:35 ` [PATCH 09/10] btrfs-progs: add --disable-backtrace Karel Zak
2014-12-12 12:35 ` [PATCH 10/10] btrfs-progs: add --disable-documentation Karel Zak
2014-12-17 14:07 ` btrfs-prog: improve build-system by autoconf David Sterba
2014-12-18 13:31 ` Karel Zak
2014-12-18 18:00 ` Eric Sandeen
2014-12-22 12:47 ` Koen Kooi
2015-01-16 15:26 ` Karel Zak
2015-01-28 15:38 ` David Sterba
2015-02-04 11:40 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1418387724-20188-3-git-send-email-kzak@redhat.com \
--to=kzak@redhat.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).