~ubuntu-branches/ubuntu/breezy/orbit2/breezy

« back to all changes in this revision

Viewing changes to linc2/src/linc-compat.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-09-06 16:37:02 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050906163702-hrqi0ctymth53bnn
Tags: 1:2.12.4-0ubuntu1
* New upstream version.
* debian/patches/100-compile-name-server.patch:
  - updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Herein lies a set of private ugly portability
 
3
 * hacks for the mind-numbingly broken Unix like
 
4
 * things that exist out there.
 
5
 */
 
6
#ifndef LINK_HACKS_H
 
7
#define LINK_HACKS_H
 
8
 
 
9
#include <sys/types.h>
 
10
 
 
11
#ifdef HAVE_WINSOCK2_H
 
12
#  include <winsock2.h>
 
13
#else
 
14
#  ifdef HAVE_SYS_SOCKET_H
 
15
#    include <sys/socket.h>
 
16
#  endif
 
17
#  ifdef HAVE_NETINET_IN_H
 
18
#    include <netinet/in.h>
 
19
#  endif
 
20
#  ifdef HAVE_NETDB_H
 
21
#    include <netdb.h>
 
22
#  endif
 
23
#  ifdef HAVE_NETINET_TCP_H
 
24
#    include <netinet/tcp.h>
 
25
#  endif
 
26
#  ifdef HAVE_SYS_UN_H
 
27
#    include <sys/un.h>
 
28
#  endif
 
29
#  ifdef HAVE_ARPA_INET_H
 
30
#    include <arpa/inet.h>
 
31
#  endif
 
32
#  ifdef HAVE_ARPA_NAMESER_H
 
33
#    include <arpa/nameser.h>
 
34
#  endif
 
35
#  ifdef HAVE_RESOLV_H
 
36
#    include <resolv.h>
 
37
#  endif
 
38
#endif
 
39
 
 
40
#include <sys/stat.h>
 
41
#include <sys/time.h>
 
42
#ifdef HAVE_UNISTD_H
 
43
#  include <unistd.h>
 
44
#endif
 
45
#include <stdio.h>
 
46
#include <stdlib.h>
 
47
#include <limits.h>
 
48
#include <time.h>
 
49
#ifdef HAVE_UTIME_H
 
50
#  include <utime.h>
 
51
#else
 
52
#  ifdef HAVE_SYS_UTIME_H
 
53
#    include <sys/utime.h>
 
54
#  endif
 
55
#endif
 
56
#include <errno.h>
 
57
#include <string.h>
 
58
 
 
59
#ifdef HAVE_LINUX_IRDA_H
 
60
#  include <asm/types.h>
 
61
#  include <linux/irda.h>
 
62
#endif
 
63
 
 
64
#ifndef MAXHOSTNAMELEN
 
65
#  define MAXHOSTNAMELEN 255
 
66
#endif
 
67
 
 
68
#ifdef HAVE_WINSOCK2_H
 
69
   /* Define fake errno values for socket stuff. These aren't defined
 
70
    * in the Microsoft C library. Use the WSAE* error codes as such,
 
71
    * as they don't overlap with errno values. Define only those that
 
72
    * actually are used by the linc2 code.
 
73
    */
 
74
#  ifndef ECONNREFUSED
 
75
#    define ECONNREFUSED WSAECONNREFUSED
 
76
#  endif
 
77
#  ifndef EADDRINUSE
 
78
#    define EADDRINUSE WSAEADDRINUSE
 
79
#  endif
 
80
#  ifndef EINPROGRESS
 
81
#    define EINPROGRESS WSAEINPROGRESS
 
82
#  endif
 
83
 
 
84
   /* Undefine address families that aren't really present, as the
 
85
    * linc code checks for these macros being defined when it
 
86
    * determines whether they are supported. (It would be more correct
 
87
    * to check at run-time.)
 
88
    */
 
89
#  undef AF_UNIX                /* No Unix domain sockets */
 
90
#  undef AF_INET6               /* Doesn't have sockaddr_in6 */
 
91
 
 
92
#endif
 
93
 
 
94
#if !defined (NI_MAXSERV) || !defined (NI_MAXHOST)
 
95
#  include <sys/param.h>
 
96
#endif
 
97
 
 
98
#if !defined (NI_MAXHOST)
 
99
#  define NI_MAXHOST MAXHOSTNAMELEN
 
100
#endif
 
101
 
 
102
#if !defined (NI_MAXSERV)
 
103
#  define NI_MAXSERV 64
 
104
#endif
 
105
 
 
106
#if !defined (INADDR_NONE)
 
107
#  define INADDR_NONE (-1)
 
108
#endif
 
109
 
 
110
#if !defined (UNIX_PATH_MAX)
 
111
/* UNP: 14.2 - Posix.1g at least 100 bytes */
 
112
#  define LINK_UNIX_PATH_MAX 100
 
113
#else
 
114
#  define LINK_UNIX_PATH_MAX UNIX_PATH_MAX
 
115
#endif
 
116
 
 
117
const char *link_strerror (int);
 
118
 
 
119
#endif /* LINK_HACKS_H */