diff mbox

[02/10] btrfs-progs: use config.h

Message ID 1418387724-20188-3-git-send-email-kzak@redhat.com (mailing list archive)
State Accepted
Headers show

Commit Message

Karel Zak Dec. 12, 2014, 12:35 p.m. UTC
- 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 mbox

Patch

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>