summaryrefslogtreecommitdiffstats
path: root/compat.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2010-10-27 21:34:59 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2010-10-27 21:34:59 +0000
commit58684ea9987db2bd790808c89b0e0b0964da5405 (patch)
tree3bb9fc196722c628cd7186d805a15ee1f6a4da0f /compat.h
parent914f8584ef5ddfa21e558263ab216a7f1b3445db (diff)
And more.
Diffstat (limited to 'compat.h')
-rw-r--r--compat.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/compat.h b/compat.h
index c936b68d..40aeca63 100644
--- a/compat.h
+++ b/compat.h
@@ -1,4 +1,4 @@
-/* $Id: compat.h,v 1.28 2010-10-27 21:33:15 nicm Exp $ */
+/* $Id: compat.h,v 1.29 2010-10-27 21:34:59 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -16,6 +16,9 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifndef COMPAT_H
+#define COMPAT_H
+
#ifndef __GNUC__
#define __attribute__(a)
#endif
@@ -60,10 +63,6 @@ typedef uint64_t u_int64_t;
#include "compat/bitstring.h"
#endif
-#ifdef HAVE_GETOPT
-#include <getopt.h>
-#endif
-
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif
@@ -227,7 +226,9 @@ int setenv(const char *, const char *, int);
int unsetenv(const char *);
#endif
-#ifndef HAVE_GETOPT
+#ifdef HAVE_GETOPT
+#include <getopt.h>
+#else
/* getopt.c */
extern int BSDopterr;
extern int BSDoptind;
@@ -242,3 +243,5 @@ int BSDgetopt(int, char *const *, const char *);
#define optreset BSDoptreset
#define optarg BSDoptarg
#endif
+
+#endif /* COMPAT_H */