summaryrefslogtreecommitdiffstats
path: root/compat.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-07-01 22:46:13 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-07-01 22:46:13 +0000
commitec818b8791abd0d5f7a5196c61a3593cc60c5b20 (patch)
tree5ee72966cb7ca060497e6f10451f44c29c637c89 /compat.h
parent81f06ba17033095056cbe49cfbb700e84209f6c4 (diff)
Move defines after includes to avoid multiple definition.
Diffstat (limited to 'compat.h')
-rw-r--r--compat.h86
1 files changed, 43 insertions, 43 deletions
diff --git a/compat.h b/compat.h
index 1b5eeed5..8ef5eeba 100644
--- a/compat.h
+++ b/compat.h
@@ -1,4 +1,4 @@
-/* $Id: compat.h,v 1.4 2009-07-01 22:43:48 nicm Exp $ */
+/* $Id: compat.h,v 1.5 2009-07-01 22:46:13 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -16,48 +16,6 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifndef INFTIM
-#define INFTIM -1
-#endif
-
-#ifndef WAIT_ANY
-#define WAIT_ANY -1
-#endif
-
-#ifndef SUN_LEN
-#define SUN_LEN(sun) (sizeof (sun)->sun_path)
-#endif
-
-#ifndef __dead
-#define __dead __attribute__ ((__noreturn__))
-#endif
-#ifndef __packed
-#define __packed __attribute__ ((__packed__))
-#endif
-
-#ifndef timercmp
-#define timercmp(tvp, uvp, cmp) \
- (((tvp)->tv_sec == (uvp)->tv_sec) ? \
- ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
- ((tvp)->tv_sec cmp (uvp)->tv_sec))
-#endif
-
-#ifndef timeradd
-#define timeradd(tvp, uvp, vvp) \
- do { \
- (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
- (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
- if ((vvp)->tv_usec >= 1000000) { \
- (vvp)->tv_sec++; \
- (vvp)->tv_usec -= 1000000; \
- } \
- } while (0)
-#endif
-
-#ifndef TTY_NAME_MAX
-#define TTY_NAME_MAX 32
-#endif
-
#ifndef HAVE_PATHS_H
#define _PATH_BSHELL "/bin/sh"
#define _PATH_TMP "/tmp/"
@@ -119,6 +77,48 @@
#include "compat/vis.h"
#endif
+#ifndef INFTIM
+#define INFTIM -1
+#endif
+
+#ifndef WAIT_ANY
+#define WAIT_ANY -1
+#endif
+
+#ifndef SUN_LEN
+#define SUN_LEN(sun) (sizeof (sun)->sun_path)
+#endif
+
+#ifndef __dead
+#define __dead __attribute__ ((__noreturn__))
+#endif
+#ifndef __packed
+#define __packed __attribute__ ((__packed__))
+#endif
+
+#ifndef timercmp
+#define timercmp(tvp, uvp, cmp) \
+ (((tvp)->tv_sec == (uvp)->tv_sec) ? \
+ ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
+ ((tvp)->tv_sec cmp (uvp)->tv_sec))
+#endif
+
+#ifndef timeradd
+#define timeradd(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
+ if ((vvp)->tv_usec >= 1000000) { \
+ (vvp)->tv_sec++; \
+ (vvp)->tv_usec -= 1000000; \
+ } \
+ } while (0)
+#endif
+
+#ifndef TTY_NAME_MAX
+#define TTY_NAME_MAX 32
+#endif
+
#ifndef HAVE_STRTONUM
/* strtonum.c */
long long strtonum(const char *, long long, long long, const char **);