X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/812b526d127c6657e571db8b33a58137af6709cd..0b29fd3d4584bdaee16b1289fc19b43fac5eb285:/lib/common.h diff --git a/lib/common.h b/lib/common.h index 2ca41a6..99f8671 100644 --- a/lib/common.h +++ b/lib/common.h @@ -1,6 +1,6 @@ /* * This file is part of DisOrder. - * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell + * Copyright (C) 2004, 2005, 2007, 2008, 2013 Richard Kettlewell * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,8 +22,15 @@ #ifndef COMMON_H #define COMMON_H -#include +#if HAVE_CONFIG_H +# include +#endif +# define SOCKET int +# define INVALID_SOCKET (-1) +# define declspec(x) +# define socket_error() (errno) +# define system_error() (errno) #if HAVE_INTTYPES_H # include #endif @@ -110,6 +117,18 @@ 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 + #endif /* COMMENT_H */ /*