diff options
author | m0gg | 2006-12-16 17:30:36 +0000 |
---|---|---|
committer | m0gg | 2006-12-16 17:30:36 +0000 |
commit | 146afc3b7042bcc36ac56cc4cb5c5412f397e1cb (patch) | |
tree | 864e3fb7ec283a3786711a92443bda885228fed9 | |
parent | d7bead298ebcacf0726f2ea25764003526b564b7 (diff) | |
download | csoap-146afc3b7042bcc36ac56cc4cb5c5412f397e1cb.tar.gz csoap-146afc3b7042bcc36ac56cc4cb5c5412f397e1cb.tar.bz2 |
SunOS compile fixes
-rw-r--r-- | nanohttp/nanohttp-server.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/nanohttp/nanohttp-server.c b/nanohttp/nanohttp-server.c index bc7bffe..d9db9b1 100644 --- a/nanohttp/nanohttp-server.c +++ b/nanohttp/nanohttp-server.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-server.c,v 1.75 2006/12/16 15:55:24 m0gg Exp $ +* $Id: nanohttp-server.c,v 1.76 2006/12/16 17:30:36 m0gg Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -96,6 +96,30 @@ static inline int hssl_enabled(void) { return 0; } #endif #include "nanohttp-admin.h" +#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 timersub +#define timersub(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 < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_usec += 1000000; \ + } \ + } while (0) +#endif + typedef struct _conndata { volatile int flag; |