Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
9aee7c60
Commit
9aee7c60
authored
Apr 17, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Yet another attempt at fixing the htonl functions.
parent
1b41cdf3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
17 deletions
+33
-17
winsock.h
include/winsock.h
+33
-17
No files found.
include/winsock.h
View file @
9aee7c60
...
...
@@ -56,10 +56,6 @@
# 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
...
...
@@ -68,19 +64,11 @@
# 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
...
...
@@ -481,13 +469,41 @@ typedef struct WS(timeval)
#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 */
/* we have to define hton/ntoh as macros to avoid conflicts with Unix headers */
#ifndef USE_WS_PREFIX
#undef htonl
#undef htons
#undef ntohl
#undef ntohs
#ifdef WORDS_BIGENDIAN
#define htonl(l) ((u_long)(l))
#define htons(s) ((u_short)(s))
#define ntohl(l) ((u_long)(l))
#define ntohs(s) ((u_short)(s))
#else
/* WORDS_BIGENDIAN */
inline
static
u_short
__wine_ushort_swap
(
u_short
s
)
{
return
(
s
>>
8
)
|
(
s
<<
8
);
}
inline
static
u_long
__wine_ulong_swap
(
u_long
l
)
{
return
((
u_long
)
__wine_ushort_swap
(
l
)
<<
16
)
|
__wine_ushort_swap
(
l
>>
16
);
}
#define htonl(l) __wine_ulong_swap(l)
#define htons(s) __wine_ushort_swap(s)
#define ntohl(l) __wine_ulong_swap(l)
#define ntohs(s) __wine_ushort_swap(s)
#endif
/* WORDS_BIGENDIAN */
#endif
/* USE_WS_PREFIX */
/*
* Internet address (old style... should be updated)
...
...
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