~ubuntu-branches/ubuntu/hardy/prelude-manager/hardy

« back to all changes in this revision

Viewing changes to libmissing/socket_.h

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2007-03-22 18:09:27 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070322180927-tzvkkuk7yc5m0s9d
Tags: 0.9.7.2-2
* Fix permissions on configuration file (make sure it is not world-readable)
* Update my email address

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Provide a sys/socket header file for systems lacking it (read: MinGW).
2
 
   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 
2
   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
3
3
   Written by Simon Josefsson.
4
4
 
5
5
   This program is free software; you can redistribute it and/or modify
16
16
   along with this program; if not, write to the Free Software Foundation,
17
17
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
18
18
 
19
 
#ifndef _SYS_SOCKET_H
20
 
#define _SYS_SOCKET_H
21
 
 
22
 
/* This file is supposed to be used on platforms that lack
23
 
   sys/socket.h.  It is intended to provide definitions and prototypes
24
 
   needed by an application.
 
19
#ifndef _GL_SYS_SOCKET_H
 
20
#define _GL_SYS_SOCKET_H
 
21
 
 
22
/* This file is supposed to be used on platforms that lack <sys/socket.h>
 
23
   and on platforms where <sys/socket.h> cannot be included standalone.
 
24
   It is intended to provide definitions and prototypes needed by an
 
25
   application.  */
 
26
 
 
27
#if @HAVE_SYS_SOCKET_H@
 
28
 
 
29
/* On many platforms, <sys/socket.h> assumes prior inclusion of
 
30
   <sys/types.h>.  */
 
31
 
 
32
# include <sys/types.h>
 
33
# include @ABSOLUTE_SYS_SOCKET_H@
 
34
 
 
35
#else
 
36
 
 
37
/* A platform that lacks <sys/socket.h>.
25
38
 
26
39
   Currently only MinGW is supported.  See the gnulib manual regarding
27
40
   Windows sockets.  MinGW has the header files winsock2.h and
39
52
   releases. */
40
53
 
41
54
 
42
 
#if HAVE_WINSOCK2_H
43
 
# include <winsock2.h>
44
 
#endif
45
 
#if HAVE_WS2TCPIP_H
46
 
# include <ws2tcpip.h>
47
 
#endif
 
55
# if @HAVE_WINSOCK2_H@
 
56
#  include <winsock2.h>
 
57
# endif
 
58
# if @HAVE_WS2TCPIP_H@
 
59
#  include <ws2tcpip.h>
 
60
# endif
48
61
 
49
62
/* For shutdown(). */
50
 
#if !defined SHUT_RD && defined SD_RECEIVE
51
 
# define SHUT_RD SD_RECEIVE
52
 
#endif
53
 
#if !defined SHUT_WR && defined SD_SEND
54
 
# define SHUT_WR SD_SEND
55
 
#endif
56
 
#if !defined SHUT_RDWR && defined SD_BOTH
57
 
# define SHUT_RDWR SD_BOTH
58
 
#endif
59
 
 
60
 
#endif /* _SYS_SOCKET_H */
 
63
# if !defined SHUT_RD && defined SD_RECEIVE
 
64
#  define SHUT_RD SD_RECEIVE
 
65
# endif
 
66
# if !defined SHUT_WR && defined SD_SEND
 
67
#  define SHUT_WR SD_SEND
 
68
# endif
 
69
# if !defined SHUT_RDWR && defined SD_BOTH
 
70
#  define SHUT_RDWR SD_BOTH
 
71
# endif
 
72
 
 
73
# if defined _WIN32 || defined __WIN32__
 
74
#  define ENOTSOCK                WSAENOTSOCK
 
75
#  define EADDRINUSE              WSAEADDRINUSE
 
76
#  define ENETRESET               WSAENETRESET
 
77
#  define ECONNABORTED            WSAECONNABORTED
 
78
#  define ECONNRESET              WSAECONNRESET
 
79
#  define ENOTCONN                WSAENOTCONN
 
80
#  define ESHUTDOWN               WSAESHUTDOWN
 
81
# endif
 
82
 
 
83
#endif /* HAVE_SYS_SOCKET_H */
 
84
 
 
85
#endif /* _GL_SYS_SOCKET_H */