[Devel] Eliminate use of __USE_* definitions in source

Lorenz Schori lorenz.schori at gmx.ch
Sun Dec 7 10:01:33 PST 2008


According to /usr/include/features.h only the defines beginning with one
underscore should be used but not those beginning with __USE_. This
patch sets the required preprocessor flags directly in the Makefile
namely _BSD_SOURCE and _XOPEN_SOURCE=600. As an alternative _GNU_SOURCE
which includes the other two would work also.

Signed-off-by: Lorenz Schori <lorenz.schori at gmx.ch>
---
 include/vzquota.h |    2 --
 src/Makefile      |    1 +
 src/vzdqload.c    |    2 --
 3 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/include/vzquota.h b/include/vzquota.h
index ac9e96a..f18db2d 100644
--- a/include/vzquota.h
+++ b/include/vzquota.h
@@ -19,8 +19,6 @@
 #ifndef __VZQUOTA_UTIL_H__
 #define __VZQUOTA_UTIL_H__
 
-#define __USE_UNIX98
-
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/src/Makefile b/src/Makefile
index 014ee50..59177d0 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -25,6 +25,7 @@ MANDIR = ${PREFIX}/share/man
 CFLAGS += -pipe -I../include  \
 	-g -Wall -Werror -Wformat -D_FILE_OFFSET_BITS=64 \
 	-D_LINUX_QUOTA_VERSION=6 -D_LARGEFILE64_SOURCE \
+	-D_BSD_SOURCE -D_XOPEN_SOURCE=600 \
 	-DVARDIR=\"$(VARDIR)\" $(DEBUG)
 # We need -m64 for ppc64 in order to get proper ioctls
 ifeq ($(shell uname -m),ppc64)
diff --git a/src/vzdqload.c b/src/vzdqload.c
index d5625ac..7031cd9 100644
--- a/src/vzdqload.c
+++ b/src/vzdqload.c
@@ -19,8 +19,6 @@
 #include <sys/file.h>
 #include <sys/types.h>
 
-/* to include vsscanf() */
-#define __USE_ISOC99
 #include <stdio.h>
 
 #include <stdlib.h>
-- 
1.5.6.5




More information about the Devel mailing list