00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <string.h>
00018
00019 #if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME)
00020 # import <objc/runtime.h>
00021 #endif
00022
00023 #ifdef OF_OLD_GNU_RUNTIME
00024 # import <objc/objc-api.h>
00025 # define sel_getName(x) sel_get_name(x)
00026 #endif
00027
00028 #ifndef _WIN32
00029 #if !defined(HAVE_THREADSAFE_GETADDRINFO) && !defined(_PSP)
00030 # include <netdb.h>
00031 #endif
00032 # include <errno.h>
00033 # define GET_ERRNO errno
00034 # ifndef HAVE_THREADSAFE_GETADDRINFO
00035 # define GET_AT_ERRNO h_errno
00036 # else
00037 # define GET_AT_ERRNO errno
00038 # endif
00039 # define GET_SOCK_ERRNO errno
00040 # define ERRFMT "Error string was: %s"
00041 # define ERRPARAM strerror(errNo)
00042 # if !defined(HAVE_THREADSAFE_GETADDRINFO) && !defined(_PSP)
00043 # define AT_ERRPARAM hstrerror(errNo)
00044 # else
00045 # define AT_ERRPARAM strerror(errNo)
00046 # endif
00047 #else
00048 # include <windows.h>
00049 # define GET_ERRNO GetLastError()
00050 # define GET_AT_ERRNO WSAGetLastError()
00051 # define GET_SOCK_ERRNO WSAGetLastError()
00052 # define ERRFMT "Error code was: %d"
00053 # define ERRPARAM errNo
00054 # define AT_ERRPARAM errNo
00055 #endif