00001 00002 /* 00003 * The olsr.org Optimized Link-State Routing daemon(olsrd) 00004 * Copyright (c) 2004-2009, the olsr.org team - see HISTORY file 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * * Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * * Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in 00015 * the documentation and/or other materials provided with the 00016 * distribution. 00017 * * Neither the name of olsr.org, olsrd nor the names of its 00018 * contributors may be used to endorse or promote products derived 00019 * from this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00022 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00024 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00025 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00026 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00027 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00028 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00030 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00031 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 * POSSIBILITY OF SUCH DAMAGE. 00033 * 00034 * Visit http://www.olsr.org for more information. 00035 * 00036 * If you find this software useful feel free to make a donation 00037 * to the project. For more information see the website or contact 00038 * the copyright holders. 00039 * 00040 */ 00041 00042 #if !defined TL_SYS_TIME_H_INCLUDED 00043 00044 #define TL_SYS_TIME_H_INCLUDED 00045 00046 #define WIN32_LEAN_AND_MEAN 00047 #include <winsock2.h> 00048 #include <ws2tcpip.h> 00049 #undef interface 00050 00051 #define timeradd(x, y, z) \ 00052 do \ 00053 { \ 00054 (z)->tv_sec = (x)->tv_sec + (y)->tv_sec; \ 00055 \ 00056 (z)->tv_usec = (x)->tv_usec + (y)->tv_usec; \ 00057 \ 00058 if ((z)->tv_usec >= 1000000) \ 00059 { \ 00060 (z)->tv_sec++; \ 00061 (z)->tv_usec -= 1000000; \ 00062 } \ 00063 } \ 00064 while (0) 00065 00066 #define timersub(x, y, z) \ 00067 do \ 00068 { \ 00069 (z)->tv_sec = (x)->tv_sec - (y)->tv_sec; \ 00070 \ 00071 (z)->tv_usec = (x)->tv_usec - (y)->tv_usec; \ 00072 \ 00073 if ((z)->tv_usec < 0) \ 00074 { \ 00075 (z)->tv_sec--; \ 00076 (z)->tv_usec += 1000000; \ 00077 } \ 00078 } \ 00079 while (0) 00080 00081 #if !defined WINCE 00082 struct timespec { 00083 unsigned int tv_sec; 00084 unsigned int tv_nsec; 00085 }; 00086 #else 00087 #include <time.h> 00088 #endif 00089 00090 #endif 00091 00092 /* 00093 * Local Variables: 00094 * c-basic-offset: 2 00095 * indent-tabs-mode: nil 00096 * End: 00097 */
1.6.3