bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Don't define _GNU_SOURCE manually.


From: Jim Meyering
Subject: [PATCH] Don't define _GNU_SOURCE manually.
Date: Tue, 13 Feb 2007 21:02:08 +0100

It's better not to define _GNU_SOURCE manually.
By using AC_GNU_SOURCE, you get the definition in exactly one place:
in config.h.  I verified that each affected file also includes config.h.

Don't define _GNU_SOURCE manually.
* configure.ac: Use AC_GNU_SOURCE instead.
* libparted/arch/gnu.c: Remove definition of _GNU_SOURCE.
* libparted/arch/linux.c: Likewise.
* libparted/device.c: Likewise.
* parted/table.c: Likewise.
* parted/table.h: Likewise.

Signed-off-by: Jim Meyering <address@hidden>
---
 configure.ac           |    1 +
 libparted/arch/gnu.c   |    4 +---
 libparted/arch/linux.c |    6 +-----
 libparted/device.c     |    4 +---
 parted/table.c         |    2 --
 parted/table.h         |    4 +---
 6 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index d47d5fa..4d95430 100644
--- a/configure.ac
+++ b/configure.ac
@@ -166,6 +166,7 @@ AC_ISC_POSIX
 AC_PROG_CC
 AC_PROG_GCC_TRADITIONAL
 AM_PROG_CC_C_O
+AC_GNU_SOURCE
 
 dnl This test must come as early as possible after the compiler configuration
 dnl tests, because the choice of the file model can (in principle) affect
diff --git a/libparted/arch/gnu.c b/libparted/arch/gnu.c
index 57d4047..5bca98e 100644
--- a/libparted/arch/gnu.c
+++ b/libparted/arch/gnu.c
@@ -1,6 +1,6 @@
 /*
     libparted - a library for manipulating disk partitions
-    Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
+    Copyright (C) 1999, 2000, 2001, 2005, 2007 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -17,8 +17,6 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */
 
-#define _GNU_SOURCE 1
-
 #include "config.h"
 
 #include <parted/parted.h>
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 7304885..568ada3 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -1,6 +1,6 @@
 /*
     libparted - a library for manipulating disk partitions
-    Copyright (C) 1999 - 2005 Free Software Foundation, Inc.
+    Copyright (C) 1999 - 2005, 2007 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -17,10 +17,6 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */
 
-/* we need this for O_DIRECT on Linux, it's in the glibc headers */
-/* ... and for posix_memalign()                                  */
-#define _GNU_SOURCE
-
 #define PROC_DEVICES_BUFSIZ 16384
 
 #include "config.h"
diff --git a/libparted/device.c b/libparted/device.c
index 524b983..2885ed5 100644
--- a/libparted/device.c
+++ b/libparted/device.c
@@ -1,6 +1,6 @@
 /*
     libparted - a library for manipulating disk partitions
-    Copyright (C) 1999 - 2001, 2005 Free Software Foundation, Inc.
+    Copyright (C) 1999 - 2001, 2005, 2007 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -36,8 +36,6 @@
  * @{
  */
 
-#define _GNU_SOURCE 1
-
 #include "config.h"
 
 #include <parted/parted.h>
diff --git a/parted/table.c b/parted/table.c
index 1f8572d..62ce681 100644
--- a/parted/table.c
+++ b/parted/table.c
@@ -31,7 +31,6 @@
 #include <config.h>
 
 #ifdef ENABLE_NLS
-#       define _GNU_SOURCE
 #       include <wchar.h>
         int wcswidth (const wchar_t *s, size_t n);
 #      define L_(str) L##str
@@ -40,7 +39,6 @@
 #       ifdef wchar_t
 #               undef wchar_t
 #       endif
-#       define _GNU_SOURCE
 #       include <string.h>
 #       define wchar_t char
 #       define wcslen strlen
diff --git a/parted/table.h b/parted/table.h
index 5eeacd8..b423a9e 100644
--- a/parted/table.h
+++ b/parted/table.h
@@ -1,6 +1,6 @@
 /*
     parted - a frontend to libparted
-    Copyright (C) 2006 Free Software Foundation, Inc.
+    Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -17,7 +17,6 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */
 
-#define _GNU_SOURCE
 #include <wchar.h>
 
 #include <stdio.h>
@@ -30,7 +29,6 @@
 #include <config.h>
 
 #ifdef ENABLE_NLS
-#       define _GNU_SOURCE
 #       include <wchar.h>
 #else
 #       ifdef wchar_t
-- 
1.5.0.rc4.26.gcc46a-dirty





reply via email to

[Prev in Thread] Current Thread [Next in Thread]