X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/aa846a75f692251355458667d28378398fd84b67..69a3ec00896b5f6dcdd04d5250e8b9fc8aeb20fd:/lib/common.h diff --git a/lib/common.h b/lib/common.h index 9cf3892..6c90fd6 100644 --- a/lib/common.h +++ b/lib/common.h @@ -26,11 +26,17 @@ # include #endif +#if _WIN32 +# include "disorder-win32.h" +#else # define SOCKET int # define INVALID_SOCKET (-1) # define declspec(x) # define socket_error() (errno) # define system_error() (errno) +# define network_init() +#endif + #if HAVE_INTTYPES_H # include #endif @@ -117,6 +123,14 @@ typedef unsigned char uint32_t; # endif #endif +#if ! HAVE_UINT16_T +# if USHRT_MAX == 65535 +typedef unsigned short uint16_t; +# else +# error cannot determine uint16_t +# endif +#endif + #if !HAVE_CLOSESOCKET # define closesocket close #endif