Some winsock improvements

This commit is contained in:
mpc
2004-06-27 09:12:05 +00:00
committed by zzz
parent 77a8a46d8e
commit dc04b7cf09
4 changed files with 189 additions and 21 deletions

View File

@@ -44,6 +44,7 @@
#define NO_GETHOSTBYNAME2
#define NO_INET_ATON /* implies NO_INET_PTON */
#define NO_INET_NTOP
#define NO_SSIZE_T
#define NO_STRL
#define NO_Z_FORMAT
#define WINSOCK
@@ -103,6 +104,7 @@
#endif
#ifdef WINSOCK
#include <windows.h>
#include <winsock2.h>
#else
#include <unistd.h>
#endif
@@ -112,10 +114,12 @@
*/
#ifdef WINSOCK
typedef SOCKET socket_t;
typedef signed long ssize_t;
#else
typedef int socket_t;
#endif
#ifdef NO_SSIZE_T
typedef signed long ssize_t;
#endif
/*
* Prints out the file name, line number, and function name before log message

View File

@@ -86,7 +86,7 @@ extern samerr_t sam_connect(const char *samhost, uint16_t samport,
const char *destname, sam_conn_t style, uint_t tunneldepth);
extern void sam_naming_lookup(const char *name);
extern bool sam_read_buffer(void);
extern char *sam_strerror(samerr_t code);
extern const char *sam_strerror(samerr_t code);
/* SAM controls - callbacks */
extern void (*sam_diedback)(void);
extern void (*sam_logback)(char *str);