Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
9ee24137
Commit
9ee24137
authored
Apr 02, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle htonl() and friends like select(), this will hopefully avoid
conflicts with Unix headers.
parent
114b667f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
27 deletions
+26
-27
sock.c
dlls/winsock/tests/sock.c
+0
-6
winsock.h
include/winsock.h
+26
-21
No files found.
dlls/winsock/tests/sock.c
View file @
9ee24137
...
...
@@ -18,18 +18,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _WIN32
#include <winsock2.h>
#include <mswsock.h>
#include "wine/test.h"
#else
#include "wine/test.h"
#include <winbase.h>
#include <winnt.h>
#include <winerror.h>
#include <winsock2.h>
#include <mswsock.h>
#endif
#define MAX_CLIENTS 4
/* Max number of clients */
#define NUM_TESTS 2
/* Number of tests performed */
...
...
include/winsock.h
View file @
9ee24137
...
...
@@ -26,12 +26,6 @@
# endif
#endif
#ifndef __WINESRC__
# include "windows.h"
#else
# include "windef.h"
#endif
#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_
...
...
@@ -45,14 +39,10 @@
# define WS(x) x
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
/* defined(__cplusplus) */
/* proper 4-byte packing */
#include "pshpack4.h"
/*
* This section defines the items that conflict with the Unix headers.
*/
...
...
@@ -80,6 +70,10 @@ extern "C" {
# define FD_ISSET Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
# define fd_set Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
# define select Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
# define htonl Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
# define htons Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
# define ntohl Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
# define ntohs Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
# else
/* FD_CLR */
/* stdlib.h has not been included yet so it's not too late. Include it now
* making sure that none of the select symbols is affected. Then we can
...
...
@@ -88,11 +82,19 @@ extern "C" {
# define fd_set unix_fd_set
# define timeval unix_timeval
# define select unix_select
# define htonl unix_htonl
# define htons unix_htons
# define ntohl unix_ntohl
# define ntohs unix_ntohs
# include <sys/types.h>
# include <stdlib.h>
# undef fd_set
# undef timeval
# undef select
# undef htonl
# undef htons
# undef ntohl
# undef ntohs
# undef FD_SETSIZE
# undef FD_CLR
# undef FD_SET
...
...
@@ -108,6 +110,12 @@ extern "C" {
# include <stdlib.h>
#endif
/* !USE_WS_PREFIX */
#ifndef __WINESRC__
# include "windows.h"
#else
# include "windef.h"
#endif
#if defined(__MINGW_H) && !defined(MSVCRT_BSD_TYPES_DEFINED)
/* MinGW doesn't define the u_xxx types */
typedef
unsigned
char
u_char
;
...
...
@@ -116,6 +124,8 @@ typedef unsigned int u_int;
typedef
unsigned
long
u_long
;
#endif
/* proper 4-byte packing */
#include "pshpack4.h"
/*
* Address families
...
...
@@ -469,6 +479,12 @@ typedef struct WS(timeval)
#define WS_FD_ZERO(set) ((WS_fd_set*)(set))->fd_count=0)
#define WS_FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (WS_fd_set*)(set))
#endif
u_long
WINAPI
WS
(
htonl
)(
u_long
);
u_short
WINAPI
WS
(
htons
)(
u_short
);
u_long
WINAPI
WS
(
ntohl
)(
u_long
);
u_short
WINAPI
WS
(
ntohs
)(
u_short
);
#endif
/* WS_DEFINE_SELECT */
...
...
@@ -916,17 +932,6 @@ int WINAPI WS(setsockopt)(SOCKET,int,int,const char*,int);
int
WINAPI
WS
(
shutdown
)(
SOCKET
,
int
);
SOCKET
WINAPI
WS
(
socket
)(
int
,
int
,
int
);
#if defined(htonl) && !defined(USE_WS_PREFIX)
# undef htonl
# undef htons
# undef ntohl
# undef ntohs
#endif
u_long
WINAPI
WS
(
htonl
)(
u_long
);
u_short
WINAPI
WS
(
htons
)(
u_short
);
u_long
WINAPI
WS
(
ntohl
)(
u_long
);
u_short
WINAPI
WS
(
ntohs
)(
u_short
);
#if defined(__WINESRC__) || !defined(__WINE_WINSOCK2__)
/* Stuff specific to winsock.h */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment