Mercurial > hg > octave-lojdl > gnulib-hg
annotate lib/socket_.h @ 7017:005fe24b840a
Update javaexec module from GNU gettext 0.15.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 22 Jul 2006 15:17:55 +0000 |
parents | 9c5fd9877469 |
children | 76f9d13945cd |
rev | line source |
---|---|
6853
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
1 /* Provide a sys/socket header file for systems lacking it (read: MinGW). |
6536 | 2 Copyright (C) 2005, 2006 Free Software Foundation, Inc. |
3 Written by Simon Josefsson. | |
4 | |
5 This program is free software; you can redistribute it and/or modify | |
6 it under the terms of the GNU General Public License as published by | |
7 the Free Software Foundation; either version 2, or (at your option) | |
8 any later version. | |
9 | |
10 This program is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 GNU General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU General Public License | |
16 along with this program; if not, write to the Free Software Foundation, | |
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ | |
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. | |
25 | |
6853
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
26 Currently only MinGW is supported. See the gnulib manual regarding |
6857 | 27 Windows sockets. MinGW has the header files winsock2.h and |
6853
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
28 ws2tcpip.h that declare the sys/socket.h definitions we need. Note |
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
29 that you can influence which definitions you get by setting the |
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
30 WINVER symbol before including these two files. For example, |
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
31 getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that |
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
32 symbol is set indiriectly through WINVER). You can set this by |
6857 | 33 adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your |
6853
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
34 code may not run on older Windows releases then. My Windows 2000 |
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
35 box was not able to run the code, for example. The situation is |
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
36 slightly confusing because: |
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
37 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp |
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
38 suggests that getaddrinfo should be available on all Windows |
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
39 releases. */ |
d63e1000901c
2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
6619
diff
changeset
|
40 |
6536 | 41 |
42 #if HAVE_WINSOCK2_H | |
43 # include <winsock2.h> | |
44 #endif | |
45 #if HAVE_WS2TCPIP_H | |
46 # include <ws2tcpip.h> | |
47 #endif | |
48 | |
6571
f7945ef945d6
* socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents:
6536
diff
changeset
|
49 /* For shutdown(). */ |
6589
60dfc5a7a541
Remove useless parentheses in uses of cpp `defined'.
Jim Meyering <jim@meyering.net>
parents:
6588
diff
changeset
|
50 #if !defined SHUT_RD && defined SD_RECEIVE |
6571
f7945ef945d6
* socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents:
6536
diff
changeset
|
51 # define SHUT_RD SD_RECEIVE |
f7945ef945d6
* socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents:
6536
diff
changeset
|
52 #endif |
6589
60dfc5a7a541
Remove useless parentheses in uses of cpp `defined'.
Jim Meyering <jim@meyering.net>
parents:
6588
diff
changeset
|
53 #if !defined SHUT_WR && defined SD_SEND |
6588
fbe98790fd68
* socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by Bruno.
Simon Josefsson <simon@josefsson.org>
parents:
6571
diff
changeset
|
54 # define SHUT_WR SD_SEND |
6571
f7945ef945d6
* socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents:
6536
diff
changeset
|
55 #endif |
6589
60dfc5a7a541
Remove useless parentheses in uses of cpp `defined'.
Jim Meyering <jim@meyering.net>
parents:
6588
diff
changeset
|
56 #if !defined SHUT_RDWR && defined SD_BOTH |
6588
fbe98790fd68
* socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by Bruno.
Simon Josefsson <simon@josefsson.org>
parents:
6571
diff
changeset
|
57 # define SHUT_RDWR SD_BOTH |
6571
f7945ef945d6
* socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents:
6536
diff
changeset
|
58 #endif |
f7945ef945d6
* socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents:
6536
diff
changeset
|
59 |
6536 | 60 #endif /* _SYS_SOCKET_H */ |