mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-16 06:05:50 +08:00
Windows: the loop's socket results in the type the socket calls return
ssize_t does not exist under MSVC, and the socket function table already spells its send and recv results int there and ssize_t elsewhere. That type is now named SOCKRET, beside SASIZETYPE, and the event loop's copies of it use the name, so the MSVC build compiles again.
This commit is contained in:
parent
235f899668
commit
0cf5dfc6a3
@ -555,7 +555,7 @@ static void cbfail(struct cbmap *m, int side, int writing){
|
||||
/* Statistics of what went through a way, as sockmap() counts them, and
|
||||
the bandwidth limits' pause: the client's data once written to the
|
||||
server, the server's once read. A read counts for the grace. */
|
||||
static void cbcount(struct cbmap *m, struct cbway *w, int written, ssize_t n){
|
||||
static void cbcount(struct cbmap *m, struct cbway *w, int written, SOCKRET n){
|
||||
struct clientparam *param = m->param;
|
||||
int sl = 0;
|
||||
|
||||
@ -603,7 +603,7 @@ static int cbway(struct cbmap *m, struct cbway *w){
|
||||
unsigned char *buf;
|
||||
unsigned *inbuf, *offset, size;
|
||||
uint64_t inb, room;
|
||||
ssize_t n;
|
||||
SOCKRET n;
|
||||
|
||||
if(!w->left) return 0;
|
||||
cbbuf(param, w->src, &buf, &inbuf, &offset, &size);
|
||||
|
||||
@ -62,6 +62,7 @@
|
||||
#include <io.h>
|
||||
#include <process.h>
|
||||
#define SASIZETYPE int
|
||||
#define SOCKRET int /* what a socket call returns: moved bytes or -1 */
|
||||
#define SHUT_RDWR SD_BOTH
|
||||
#define SHUT_WR SD_SEND
|
||||
#define SHUT_RD SD_RECEIVE
|
||||
|
||||
@ -35,6 +35,7 @@ extern "C" {
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
#define SASIZETYPE socklen_t
|
||||
#define SOCKRET ssize_t /* what a socket call returns: moved bytes or -1 */
|
||||
#define SOCKET int
|
||||
#define INVALID_SOCKET (-1)
|
||||
#define _3proxy_mutex_t pthread_mutex_t
|
||||
|
||||
Loading…
Reference in New Issue
Block a user