switch4g: completely re-writen
[tomato.git] / release / src / router / udpxy / osdef.h
blobce3b96f45eebf7bfe8a41a3713bd77124edba35d
1 /* @(#) define OS-specific types/constants
3 * Copyright 2008-2011 Pavel V. Cherenkov (pcherenkov@gmail.com) (pcherenkov@gmail.com)
5 * This file is part of udpxy.
7 * udpxy is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * udpxy is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with udpxy. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef UDPXY_OSDEFH_0101082158
22 #define UDPXY_OSDEFH_0101082158
24 #include <sys/socket.h>
26 /* define OS-specific types/constants
30 #define HAS_SOCKLEN
31 #define HAS_SETLINEBUF
32 #define HAS_VARRUN
33 #define HAS_VARTMP
35 #ifdef __hpux
36 #undef HAS_SOCKLEN
37 #undef HAS_SETLINEBUF
38 #define NO_SOCKADDR_SA_LEN
39 #endif
41 #if defined(__CYGWIN__)
42 #define NO_INET6_SUPPORT
43 #define NO_SOCKADDR_SA_LEN
44 #endif
46 #if defined(__linux)
47 #define NO_SOCKADDR_SA_LEN
48 #endif
50 #ifndef HAS_SOCKLEN
51 typedef int a_socklen_t;
52 #else
53 typedef socklen_t a_socklen_t;
54 #endif
56 #ifndef HAS_SETLINEBUF
57 #define Setlinebuf(a) setvbuf(a, NULL, _IOLBF, BUFSIZ)
58 #else
59 #define Setlinebuf(a) setlinebuf(a)
60 #endif
62 #if defined(HAS_VARRUN)
63 #define PIDFILE_DIR "/var/run"
64 #elif defined(HAS_VARTMP)
65 #define PIDFILE_DIR "/var/tmp"
66 #endif
68 #endif /* UDPXY_OSDEFH_0101082158 */
70 /* __EOF__ */