diff options
author | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-08-19 11:03:19 +0400 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-08-30 21:37:14 +0400 |
commit | 74bd343ae83398c7e00c239aea1ff8525dc958a1 (patch) | |
tree | ecf99df643631ed691195629b930177c2fb00eb9 /src/netops.h | |
parent | f978b748bb50beb0ccbebc3aa118ad289e4c9cba (diff) |
Fix Windows compilation
Sockets on Windows are unsigned, so define a type GIT_SOCKET which is
signed or unsigned depending on the platform.
Thanks to Em for his patience with this.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Diffstat (limited to 'src/netops.h')
-rw-r--r-- | src/netops.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/netops.h b/src/netops.h index c828ed9f3..d18116f34 100644 --- a/src/netops.h +++ b/src/netops.h @@ -4,11 +4,17 @@ #ifndef INCLUDE_netops_h__ #define INCLUDE_netops_h__ +#ifndef _WIN32 +typedef int GIT_SOCKET; +#else +typedef unsigned int GIT_SOCKET; +#endif + typedef struct gitno_buffer { char *data; unsigned int len; unsigned int offset; - int fd; + GIT_SOCKET fd; } gitno_buffer; void gitno_buffer_setup(gitno_buffer *buf, char *data, unsigned int len, int fd); @@ -18,5 +24,6 @@ void gitno_consume_n(gitno_buffer *buf, unsigned int cons); int gitno_connect(const char *host, const char *port); int gitno_send(int s, const char *msg, int len, int flags); +int gitno_select_in(gitno_buffer *buf, long int sec, long int usec); #endif |