From ec818b8791abd0d5f7a5196c61a3593cc60c5b20 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 1 Jul 2009 22:46:13 +0000 Subject: Move defines after includes to avoid multiple definition. --- compat.h | 86 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'compat.h') 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 @@ -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 **); -- cgit v1.2.3