Move getopt() portability fiddles out of system.h
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 23 Dec 2009 12:02:19 +0000 (14:02 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 23 Dec 2009 12:02:19 +0000 (14:02 +0200)
- only macro.c needs, no point polluting includes everywhere

rpmio/macro.c
system.h

index 11e23a3..f12091f 100644 (file)
@@ -4,6 +4,12 @@
 
 #include "system.h"
 #include <stdarg.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#else
+extern char *optarg;
+extern int optind;
+#endif
 
 #if !defined(isblank)
 #define        isblank(_c)     ((_c) == ' ' || (_c) == '\t')
index a02ae24..bdcb3a7 100644 (file)
--- a/system.h
+++ b/system.h
@@ -155,10 +155,6 @@ char *realpath(const char *path, char resolved_path []);
 #include <sys/wait.h>
 #endif
 
-#if HAVE_GETOPT_H
-#include <getopt.h>
-#endif
-
 #if HAVE_LIMITS_H
 #include <limits.h>
 #endif