diff --git a/sc2/src/port.h b/sc2/src/port.h index e85b45e43..e95b698d4 100644 --- a/sc2/src/port.h +++ b/sc2/src/port.h @@ -154,275 +154,281 @@ typedef unsigned int wint_t; // errno error numbers. The values used don't matter, as long as they // don't conflict with existing errno error numbers. -#if defined (PORT_WANT_ERRNO) && defined (USE_WINSOCK) -# include -# ifndef E2BIG -# define E2BIG 0x01000001 -# endif -# ifndef EACCES -# define EACCES 0x01000002 -# endif -# ifndef EADDRINUSE -# define EADDRINUSE 0x01000003 -# endif -# ifndef EADDRNOTAVAIL -# define EADDRNOTAVAIL 0x01000004 -# endif -# ifndef EAFNOSUPPORT -# define EAFNOSUPPORT 0x01000005 -# endif -# ifndef EAGAIN -# ifdef EWOULDBLOCK -# define EAGAIN EWOULDBLOCK -# else -# define EAGAIN 0x01000006 +#ifdef PORT_WANT_ERRNO +# ifdef USE_WINSOCK +# include +# ifndef E2BIG +# define E2BIG 0x01000001 # endif -# endif -# ifndef EALREADY -# define EALREADY 0x01000007 -# endif -# ifndef EBADF -# define EBADF 0x01000008 -# endif -# ifndef EBADMSG -# define EBADMSG 0x01000009 -# endif -# ifndef EBUSY -# define EBUSY 0x0100000a -# endif -# ifndef ECANCELED -# define ECANCELED 0x0100000b -# endif -# ifndef ECHILD -# define ECHILD 0x0100000c -# endif -# ifndef ECONNABORTED -# define ECONNABORTED 0x0100000d -# endif -# ifndef ECONNREFUSED -# define ECONNREFUSED 0x0100000e -# endif -# ifndef ECONNRESET -# define ECONNRESET 0x0100000f -# endif -# ifndef EDEADLK -# define EDEADLK 0x01000010 -# endif -# ifndef EDESTADDRREQ -# define EDESTADDRREQ 0x01000011 -# endif -# ifndef EDOM -# define EDOM 0x01000012 -# endif +# ifndef EACCES +# define EACCES 0x01000002 +# endif +# ifndef EADDRINUSE +# define EADDRINUSE 0x01000003 +# endif +# ifndef EADDRNOTAVAIL +# define EADDRNOTAVAIL 0x01000004 +# endif +# ifndef EAFNOSUPPORT +# define EAFNOSUPPORT 0x01000005 +# endif +# ifndef EAGAIN +# ifdef EWOULDBLOCK +# define EAGAIN EWOULDBLOCK +# else +# define EAGAIN 0x01000006 +# endif +# endif +# ifndef EALREADY +# define EALREADY 0x01000007 +# endif +# ifndef EBADF +# define EBADF 0x01000008 +# endif +# ifndef EBADMSG +# define EBADMSG 0x01000009 +# endif +# ifndef EBUSY +# define EBUSY 0x0100000a +# endif +# ifndef ECANCELED +# define ECANCELED 0x0100000b +# endif +# ifndef ECHILD +# define ECHILD 0x0100000c +# endif +# ifndef ECONNABORTED +# define ECONNABORTED 0x0100000d +# endif +# ifndef ECONNREFUSED +# define ECONNREFUSED 0x0100000e +# endif +# ifndef ECONNRESET +# define ECONNRESET 0x0100000f +# endif +# ifndef EDEADLK +# define EDEADLK 0x01000010 +# endif +# ifndef EDESTADDRREQ +# define EDESTADDRREQ 0x01000011 +# endif +# ifndef EDOM +# define EDOM 0x01000012 +# endif // Reserved in POSIX -//# ifndef //EDQUOT -//# define //EDQUOT 0x01000013 -//# endif -# ifndef EEXIST -# define EEXIST 0x01000014 -# endif -# ifndef EFAULT -# define EFAULT 0x01000015 -# endif -# ifndef EFBIG -# define EFBIG 0x01000016 -# endif -# ifndef EHOSTUNREACH -# define EHOSTUNREACH 0x01000017 -# endif -# ifndef EIDRM -# define EIDRM 0x01000018 -# endif -# ifndef EILSEQ -# define EILSEQ 0x01000019 -# endif -# ifndef EINPROGRESS -# define EINPROGRESS 0x0100001a -# endif -# ifndef EINTR -# define EINTR 0x0100001b -# endif -# ifndef EINVAL -# define EINVAL 0x0100001c -# endif -# ifndef EIO -# define EIO 0x0100001d -# endif -# ifndef EISCONN -# define EISCONN 0x0100001e -# endif -# ifndef EISDIR -# define EISDIR 0x0100001f -# endif -# ifndef ELOOP -# define ELOOP 0x01000020 -# endif -# ifndef EMFILE -# define EMFILE 0x01000021 -# endif -# ifndef EMLINK -# define EMLINK 0x01000022 -# endif -# ifndef EMSGSIZE -# define EMSGSIZE 0x01000023 -# endif +//# ifndef //EDQUOT +//# define //EDQUOT 0x01000013 +//# endif +# ifndef EEXIST +# define EEXIST 0x01000014 +# endif +# ifndef EFAULT +# define EFAULT 0x01000015 +# endif +# ifndef EFBIG +# define EFBIG 0x01000016 +# endif +# ifndef EHOSTUNREACH +# define EHOSTUNREACH 0x01000017 +# endif +# ifndef EIDRM +# define EIDRM 0x01000018 +# endif +# ifndef EILSEQ +# define EILSEQ 0x01000019 +# endif +# ifndef EINPROGRESS +# define EINPROGRESS 0x0100001a +# endif +# ifndef EINTR +# define EINTR 0x0100001b +# endif +# ifndef EINVAL +# define EINVAL 0x0100001c +# endif +# ifndef EIO +# define EIO 0x0100001d +# endif +# ifndef EISCONN +# define EISCONN 0x0100001e +# endif +# ifndef EISDIR +# define EISDIR 0x0100001f +# endif +# ifndef ELOOP +# define ELOOP 0x01000020 +# endif +# ifndef EMFILE +# define EMFILE 0x01000021 +# endif +# ifndef EMLINK +# define EMLINK 0x01000022 +# endif +# ifndef EMSGSIZE +# define EMSGSIZE 0x01000023 +# endif // Reserved in POSIX -//# ifndef //EMULTIHOP -//# define //EMULTIHOP 0x01000024 -//# endif -# ifndef ENAMETOOLONG -# define ENAMETOOLONG 0x01000025 -# endif -# ifndef ENETDOWN -# define ENETDOWN 0x01000026 -# endif -# ifndef ENETRESET -# define ENETRESET 0x01000027 -# endif -# ifndef ENETUNREACH -# define ENETUNREACH 0x01000028 -# endif -# ifndef ENFILE -# define ENFILE 0x01000029 -# endif -# ifndef ENOBUFS -# define ENOBUFS 0x0100002a -# endif -# ifndef ENODATA -# define ENODATA 0x0100002b -# endif -# ifndef ENODEV -# define ENODEV 0x0100002c -# endif -# ifndef ENOENT -# define ENOENT 0x0100002d -# endif -# ifndef ENOEXEC -# define ENOEXEC 0x0100002e -# endif -# ifndef ENOLCK -# define ENOLCK 0x0100002f -# endif +//# ifndef //EMULTIHOP +//# define //EMULTIHOP 0x01000024 +//# endif +# ifndef ENAMETOOLONG +# define ENAMETOOLONG 0x01000025 +# endif +# ifndef ENETDOWN +# define ENETDOWN 0x01000026 +# endif +# ifndef ENETRESET +# define ENETRESET 0x01000027 +# endif +# ifndef ENETUNREACH +# define ENETUNREACH 0x01000028 +# endif +# ifndef ENFILE +# define ENFILE 0x01000029 +# endif +# ifndef ENOBUFS +# define ENOBUFS 0x0100002a +# endif +# ifndef ENODATA +# define ENODATA 0x0100002b +# endif +# ifndef ENODEV +# define ENODEV 0x0100002c +# endif +# ifndef ENOENT +# define ENOENT 0x0100002d +# endif +# ifndef ENOEXEC +# define ENOEXEC 0x0100002e +# endif +# ifndef ENOLCK +# define ENOLCK 0x0100002f +# endif // Reserved in POSIX -//# ifndef ENOLINK -//# define ENOLINK 0x01000030 -//# endif -# ifndef ENOMEM -# define ENOMEM 0x01000031 -# endif -# ifndef ENOMSG -# define ENOMSG 0x01000032 -# endif -# ifndef ENOPROTOOPT -# define ENOPROTOOPT 0x01000033 -# endif -# ifndef ENOSPC -# define ENOSPC 0x01000034 -# endif -# ifndef ENOSR -# define ENOSR 0x01000035 -# endif -# ifndef ENOSTR -# define ENOSTR 0x01000036 -# endif -# ifndef ENOSYS -# define ENOSYS 0x01000037 -# endif -# ifndef ENOTCONN -# define ENOTCONN 0x01000038 -# endif -# ifndef ENOTDIR -# define ENOTDIR 0x01000039 -# endif -# ifndef ENOTEMPTY -# define ENOTEMPTY 0x0100003a -# endif -# ifndef ENOTSOCK -# define ENOTSOCK 0x0100003b -# endif -# ifndef ENOTSUP -# define ENOTSUP 0x0100003c -# endif -# ifndef ENOTTY -# define ENOTTY 0x0100003d -# endif -# ifndef ENXIO -# define ENXIO 0x0100003e -# endif -# ifndef EOPNOTSUPP -# define EOPNOTSUPP 0x0100003f -# endif -# ifndef EOVERFLOW -# define EOVERFLOW 0x01000040 -# endif -# ifndef EPERM -# define EPERM 0x01000041 -# endif -# ifndef EPIPE -# define EPIPE 0x01000042 -# endif -# ifndef EPROTO -# define EPROTO 0x01000043 -# endif -# ifndef EPROTONOSUPPORT -# define EPROTONOSUPPORT 0x01000044 -# endif -# ifndef EPROTOTYPE -# define EPROTOTYPE 0x01000045 -# endif -# ifndef ERANGE -# define ERANGE 0x01000046 -# endif -# ifndef EROFS -# define EROFS 0x01000047 -# endif -# ifndef ESPIPE -# define ESPIPE 0x01000048 -# endif -# ifndef ESRCH -# define ESRCH 0x01000049 -# endif +//# ifndef ENOLINK +//# define ENOLINK 0x01000030 +//# endif +# ifndef ENOMEM +# define ENOMEM 0x01000031 +# endif +# ifndef ENOMSG +# define ENOMSG 0x01000032 +# endif +# ifndef ENOPROTOOPT +# define ENOPROTOOPT 0x01000033 +# endif +# ifndef ENOSPC +# define ENOSPC 0x01000034 +# endif +# ifndef ENOSR +# define ENOSR 0x01000035 +# endif +# ifndef ENOSTR +# define ENOSTR 0x01000036 +# endif +# ifndef ENOSYS +# define ENOSYS 0x01000037 +# endif +# ifndef ENOTCONN +# define ENOTCONN 0x01000038 +# endif +# ifndef ENOTDIR +# define ENOTDIR 0x01000039 +# endif +# ifndef ENOTEMPTY +# define ENOTEMPTY 0x0100003a +# endif +# ifndef ENOTSOCK +# define ENOTSOCK 0x0100003b +# endif +# ifndef ENOTSUP +# define ENOTSUP 0x0100003c +# endif +# ifndef ENOTTY +# define ENOTTY 0x0100003d +# endif +# ifndef ENXIO +# define ENXIO 0x0100003e +# endif +# ifndef EOPNOTSUPP +# define EOPNOTSUPP 0x0100003f +# endif +# ifndef EOVERFLOW +# define EOVERFLOW 0x01000040 +# endif +# ifndef EPERM +# define EPERM 0x01000041 +# endif +# ifndef EPIPE +# define EPIPE 0x01000042 +# endif +# ifndef EPROTO +# define EPROTO 0x01000043 +# endif +# ifndef EPROTONOSUPPORT +# define EPROTONOSUPPORT 0x01000044 +# endif +# ifndef EPROTOTYPE +# define EPROTOTYPE 0x01000045 +# endif +# ifndef ERANGE +# define ERANGE 0x01000046 +# endif +# ifndef EROFS +# define EROFS 0x01000047 +# endif +# ifndef ESPIPE +# define ESPIPE 0x01000048 +# endif +# ifndef ESRCH +# define ESRCH 0x01000049 +# endif // Reserved in POSIX -//# ifndef //ESTALE -//# define //ESTALE 0x0100004a -//# endif -# ifndef ETIME -# define ETIME 0x0100004b -# endif -# ifndef ETIMEDOUT -# define ETIMEDOUT 0x0100004c -# endif -# ifndef ETXTBSY -# define ETXTBSY 0x0100004d -# endif -# ifndef EWOULDBLOCK -# ifdef EAGAIN -# define EWOULDBLOCK EAGAIN -# else -# define EWOULDBLOCK 0x0100004e +//# ifndef //ESTALE +//# define //ESTALE 0x0100004a +//# endif +# ifndef ETIME +# define ETIME 0x0100004b +# endif +# ifndef ETIMEDOUT +# define ETIMEDOUT 0x0100004c +# endif +# ifndef ETXTBSY +# define ETXTBSY 0x0100004d +# endif +# ifndef EWOULDBLOCK +# ifdef EAGAIN +# define EWOULDBLOCK EAGAIN +# else +# define EWOULDBLOCK 0x0100004e +# endif +# endif +# ifndef EXDEV +# define EXDEV 0x0100004f # endif -# endif -# ifndef EXDEV -# define EXDEV 0x0100004f -# endif // Non-POSIX: -# ifndef EHOSTDOWN -# define EHOSTDOWN 0x01100001 -# endif -# ifndef EPFNOSUPPORT -# define EPFNOSUPPORT 0x01100002 -# endif -# ifndef EPROCLIM -# define EPROCLIM 0x01100003 -# endif -# ifndef ESHUTDOWN -# define ESHUTDOWN 0x01100004 -# endif -# ifndef ESOCKTNOSUPPORT -# define ESOCKTNOSUPPORT 0x01100005 -# endif -#endif /* defined (PORT_WANT_ERRNO) && defined (_MSC_VER) */ +# ifndef EHOSTDOWN +# define EHOSTDOWN 0x01100001 +# endif +# ifndef EPFNOSUPPORT +# define EPFNOSUPPORT 0x01100002 +# endif +# ifndef EPROCLIM +# define EPROCLIM 0x01100003 +# endif +# ifndef ESHUTDOWN +# define ESHUTDOWN 0x01100004 +# endif +# ifndef ESOCKTNOSUPPORT +# define ESOCKTNOSUPPORT 0x01100005 +# endif +# elif defined (__FreeBSD__) || defined (__OpenBSD__) +# ifndef EBADMSG +# define EBADMSG EIO +# endif +# endif /* defined (__FreeBSD__) || defined (__OpenBSD__) */ +#endif /* defined (PORT_WANT_ERRNO) */ // Use SDL_INCLUDE and SDL_IMAGE_INCLUDE to portably include the SDL files // from the right location.