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
cd6b50e7
Commit
cd6b50e7
authored
Jul 31, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the #ifdefs for the getnetby* etc. functions directly into the
winsock implementation to avoid having to redefine the data structures in port.h.
parent
6f268f13
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
98 deletions
+18
-98
async.c
dlls/winsock/async.c
+8
-0
socket.c
dlls/winsock/socket.c
+6
-1
protocol.c
dlls/wsock32/protocol.c
+4
-0
port.h
include/wine/port.h
+0
-42
port.c
library/port.c
+0
-55
No files found.
dlls/winsock/async.c
View file @
cd6b50e7
...
...
@@ -423,6 +423,7 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) {
}
break
;
case
AQ_GETPROTO
:
{
#if defined(HAVE_GETPROTOBYNAME) && defined(HAVE_GETPROTOBYNUMBER)
struct
protoent
*
pe
;
char
*
copy_protoent
=
targetptr
;
EnterCriticalSection
(
&
csWSgetXXXbyYYY
);
...
...
@@ -445,6 +446,9 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) {
fail
=
WSANO_DATA
;
}
LeaveCriticalSection
(
&
csWSgetXXXbyYYY
);
#else
fail
=
WSANO_DATA
;
#endif
}
break
;
case
AQ_GETSERV
:
{
...
...
@@ -453,7 +457,11 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) {
EnterCriticalSection
(
&
csWSgetXXXbyYYY
);
se
=
(
aq
->
flags
&
AQ_NAME
)
?
getservbyname
(
aq
->
serv_name
,
aq
->
serv_proto
)
:
#ifdef HAVE_GETSERVBYPORT
getservbyport
(
aq
->
serv_port
,
aq
->
serv_proto
);
#else
NULL
;
#endif
if
(
se
)
{
size
=
WS_copy_se
(
copy_servent
,(
char
*
)
aq
->
sbuf
,
aq
->
sbuflen
,
se
,
aq
->
flags
);
if
(
size
<
0
)
{
...
...
dlls/winsock/socket.c
View file @
cd6b50e7
...
...
@@ -2996,7 +2996,7 @@ struct WS_hostent* WINAPI WS_gethostbyname(const char* name)
static
WIN_protoent
*
__ws_getprotobyname
(
const
char
*
name
,
int
dup_flag
)
{
WIN_protoent
*
retval
=
NULL
;
#ifdef HAVE_GETPROTOBYNAME
struct
protoent
*
proto
;
EnterCriticalSection
(
&
csWSgetXXXbyYYY
);
if
(
(
proto
=
getprotobyname
(
name
))
!=
NULL
)
...
...
@@ -3011,6 +3011,7 @@ static WIN_protoent* __ws_getprotobyname(const char *name, int dup_flag)
SetLastError
(
WSANO_DATA
);
}
LeaveCriticalSection
(
&
csWSgetXXXbyYYY
);
#endif
return
retval
;
}
...
...
@@ -3040,6 +3041,7 @@ struct WS_protoent* WINAPI WS_getprotobyname(const char* name)
static
WIN_protoent
*
__ws_getprotobynumber
(
int
number
,
int
dup_flag
)
{
WIN_protoent
*
retval
=
NULL
;
#ifdef HAVE_GETPROTOBYNUMBER
struct
protoent
*
proto
;
EnterCriticalSection
(
&
csWSgetXXXbyYYY
);
if
(
(
proto
=
getprotobynumber
(
number
))
!=
NULL
)
...
...
@@ -3054,6 +3056,7 @@ static WIN_protoent* __ws_getprotobynumber(int number, int dup_flag)
SetLastError
(
WSANO_DATA
);
}
LeaveCriticalSection
(
&
csWSgetXXXbyYYY
);
#endif
return
retval
;
}
...
...
@@ -3134,6 +3137,7 @@ struct WS_servent* WINAPI WS_getservbyname(const char *name, const char *proto)
static
WIN_servent
*
__ws_getservbyport
(
int
port
,
const
char
*
proto
,
int
dup_flag
)
{
WIN_servent
*
retval
=
NULL
;
#ifdef HAVE_GETSERVBYPORT
struct
servent
*
serv
;
if
(
!
proto
||
wsi_strtolo
(
proto
,
NULL
))
{
EnterCriticalSection
(
&
csWSgetXXXbyYYY
);
...
...
@@ -3151,6 +3155,7 @@ static WIN_servent* __ws_getservbyport(int port, const char* proto, int dup_flag
LeaveCriticalSection
(
&
csWSgetXXXbyYYY
);
}
else
SetLastError
(
WSAENOBUFS
);
#endif
return
retval
;
}
...
...
dlls/wsock32/protocol.c
View file @
cd6b50e7
...
...
@@ -303,5 +303,9 @@ UINT WINAPI WSOCK32_inet_network(const char *cp)
*/
struct
netent
*
WINAPI
WSOCK32_getnetbyname
(
const
char
*
name
)
{
#ifdef HAVE_GETNETBYNAME
return
getnetbyname
(
name
);
#else
return
NULL
;
#endif
}
include/wine/port.h
View file @
cd6b50e7
...
...
@@ -61,23 +61,6 @@ typedef unsigned int size_t;
typedef
int
ssize_t
;
#endif
#if !defined(HAVE_GETNETBYADDR) && !defined(HAVE_GETNETBYNAME)
struct
netent
{
char
*
n_name
;
char
**
n_aliases
;
int
n_addrtype
;
unsigned
long
n_net
;
};
#endif
/* !defined(HAVE_GETNETBYADDR) && !defined(HAVE_GETNETBYNAME) */
#if !defined(HAVE_GETPROTOBYNAME) && !defined(HAVE_GETPROTOBYNUMBER)
struct
protoent
{
char
*
p_name
;
char
**
p_aliases
;
int
p_proto
;
};
#endif
/* !defined(HAVE_GETPROTOBYNAME) && !defined(HAVE_GETPROTOBYNUMBER) */
#ifndef HAVE_STATFS
# ifdef __BEOS__
# define STATFS_HAS_BFREE
...
...
@@ -186,30 +169,10 @@ struct statfs;
int
clone
(
int
(
*
fn
)(
void
*
arg
),
void
*
stack
,
int
flags
,
void
*
arg
);
#endif
/* !defined(HAVE_CLONE) && defined(linux) */
#ifndef HAVE_GETNETBYADDR
struct
netent
*
getnetbyaddr
(
unsigned
long
net
,
int
type
);
#endif
/* defined(HAVE_GETNETBYNAME) */
#ifndef HAVE_GETNETBYNAME
struct
netent
*
getnetbyname
(
const
char
*
name
);
#endif
/* defined(HAVE_GETNETBYNAME) */
#ifndef HAVE_GETPAGESIZE
size_t
getpagesize
(
void
);
#endif
/* HAVE_GETPAGESIZE */
#ifndef HAVE_GETPROTOBYNAME
struct
protoent
*
getprotobyname
(
const
char
*
name
);
#endif
/* !defined(HAVE_GETPROTOBYNAME) */
#ifndef HAVE_GETPROTOBYNUMBER
struct
protoent
*
getprotobynumber
(
int
proto
);
#endif
/* !defined(HAVE_GETPROTOBYNUMBER) */
#ifndef HAVE_GETSERVBYPORT
struct
servent
*
getservbyport
(
int
port
,
const
char
*
proto
);
#endif
/* !defined(HAVE_GETSERVBYPORT) */
#ifndef HAVE_GETSOCKOPT
int
getsockopt
(
int
socket
,
int
level
,
int
option_name
,
void
*
option_value
,
size_t
*
option_len
);
#endif
/* !defined(HAVE_GETSOCKOPT) */
...
...
@@ -325,12 +288,7 @@ extern long interlocked_xchg_add( long *dest, long incr );
#define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable
#define clone __WINE_NOT_PORTABLE(clone)
#define getnetbyaddr __WINE_NOT_PORTABLE(getnetbyaddr)
#define getnetbyname __WINE_NOT_PORTABLE(getnetbyname)
#define getpagesize __WINE_NOT_PORTABLE(getpagesize)
#define getprotobyname __WINE_NOT_PORTABLE(getprotobyname)
#define getprotobynumber __WINE_NOT_PORTABLE(getprotobynumber)
#define getservbyport __WINE_NOT_PORTABLE(getservbyport)
#define getsockopt __WINE_NOT_PORTABLE(getsockopt)
#define inet_network __WINE_NOT_PORTABLE(inet_network)
#define lstat __WINE_NOT_PORTABLE(lstat)
...
...
library/port.c
View file @
cd6b50e7
...
...
@@ -216,61 +216,6 @@ int strncasecmp( const char *str1, const char *str2, size_t n )
#endif
/* HAVE_STRNCASECMP */
/***********************************************************************
* getnetbyaddr
*/
#ifndef HAVE_GETNETBYADDR
struct
netent
*
getnetbyaddr
(
unsigned
long
net
,
int
type
)
{
errno
=
ENOSYS
;
return
NULL
;
}
#endif
/* defined(HAVE_GETNETBYNAME) */
/***********************************************************************
* getnetbyname
*/
#ifndef HAVE_GETNETBYNAME
struct
netent
*
getnetbyname
(
const
char
*
name
)
{
errno
=
ENOSYS
;
return
NULL
;
}
#endif
/* defined(HAVE_GETNETBYNAME) */
/***********************************************************************
* getprotobyname
*/
#ifndef HAVE_GETPROTOBYNAME
struct
protoent
*
getprotobyname
(
const
char
*
name
)
{
errno
=
ENOSYS
;
return
NULL
;
}
#endif
/* !defined(HAVE_GETPROTOBYNAME) */
/***********************************************************************
* getprotobynumber
*/
#ifndef HAVE_GETPROTOBYNUMBER
struct
protoent
*
getprotobynumber
(
int
proto
)
{
errno
=
ENOSYS
;
return
NULL
;
}
#endif
/* !defined(HAVE_GETPROTOBYNUMBER) */
/***********************************************************************
* getservbyport
*/
#ifndef HAVE_GETSERVBYPORT
struct
servent
*
getservbyport
(
int
port
,
const
char
*
proto
)
{
errno
=
ENOSYS
;
return
NULL
;
}
#endif
/* !defined(HAVE_GETSERVBYPORT) */
/***********************************************************************
* getsockopt
*/
#ifndef HAVE_GETSOCKOPT
...
...
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