diff options
Diffstat (limited to 'ext/mysql/libmysql/global.h')
-rw-r--r-- | ext/mysql/libmysql/global.h | 61 |
1 files changed, 48 insertions, 13 deletions
diff --git a/ext/mysql/libmysql/global.h b/ext/mysql/libmysql/global.h index 2257c49969..968c2bddb6 100644 --- a/ext/mysql/libmysql/global.h +++ b/ext/mysql/libmysql/global.h @@ -29,14 +29,14 @@ This file is public domain and comes with NO WARRANTY of any kind */ #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) #include <config-win.h> +#elif defined(OS2) +#include <config-os2.h> #else #include <my_config.h> -#endif -#if defined(__cplusplus) -#if defined(inline) +#if defined(__cplusplus) && defined(inline) #undef inline /* fix configure problem */ #endif -#endif /* _cplusplus */ +#endif /* _WIN32... */ /* Fix problem with S_ISLNK() on Linux */ #if defined(HAVE_LINUXTHREADS) @@ -62,7 +62,7 @@ This file is public domain and comes with NO WARRANTY of any kind */ #define __STDC_EXT__ 1 /* To get large file support on hpux */ #endif -#if defined(THREAD) && !defined(__WIN__) +#if defined(THREAD) && !defined(__WIN__) && !defined(OS2) #ifndef _POSIX_PTHREAD_SEMANTICS #define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */ #endif @@ -197,6 +197,11 @@ This file is public domain and comes with NO WARRANTY of any kind */ #ifdef DONT_USE_FINITE /* HPUX 11.x has is_finite() */ #undef HAVE_FINITE #endif +#if defined(HPUX) && defined(_LARGEFILE64_SOURCE) && defined(THREAD) +/* Fix bug in setrlimit */ +#undef setrlimit +#define setrlimit cma_setrlimit64 +#endif /* We can not live without these */ @@ -206,7 +211,9 @@ This file is public domain and comes with NO WARRANTY of any kind */ #define POSIX_MISTAKE 1 /* regexp: Fix stupid spec error */ #define USE_REGEX 1 /* We want the use the regex library */ /* Do not define for ultra sparcs */ +#ifndef OS2 #define USE_BMOVE512 1 /* Use this unless the system bmove is faster */ +#endif /* Paranoid settings. Define I_AM_PARANOID if you are paranoid */ #ifdef I_AM_PARANOID @@ -250,12 +257,8 @@ int __void__; #endif #if defined(__EMX__) || !defined(HAVE_UINT) -#undef uint -#undef ushort -#undef ulong typedef unsigned int uint; typedef unsigned short ushort; -typedef unsigned long ulong; #endif #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0) @@ -460,7 +463,11 @@ extern double my_atof(const char*); #endif #undef remove /* Crashes MySQL on SCO 5.0.0 */ #ifndef __WIN__ +#ifdef OS2 +#define closesocket(A) soclose(A) +#else #define closesocket(A) close(A) +#endif #ifndef ulonglong2double #define ulonglong2double(A) ((double) (A)) #define my_off_t2double(A) ((double) (A)) @@ -549,9 +556,13 @@ typedef long my_ptrdiff_t; #ifndef NEAR #define NEAR /* Who needs segments ? */ #define FAR /* On a good machine */ +#ifndef HUGE_PTR #define HUGE_PTR #endif -#ifndef STDCALL +#endif +#if defined(__IBMC__) || defined(__IBMCPP__) +#define STDCALL _System _Export +#elif !defined( STDCALL) #define STDCALL #endif @@ -591,8 +602,8 @@ typedef unsigned long ulong; /* Short for unsigned long */ #endif #ifndef longlong_defined #if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8 -typedef unsigned long long ulonglong; /* ulong or unsigned long long */ -typedef long long longlong; +typedef unsigned long long int ulonglong; /* ulong or unsigned long long */ +typedef long long int longlong; #else typedef unsigned long ulonglong; /* ulong or unsigned long long */ typedef long longlong; @@ -619,10 +630,34 @@ typedef ulonglong my_off_t; typedef unsigned long my_off_t; #endif #define MY_FILEPOS_ERROR (~(my_off_t) 0) -#ifndef __WIN__ +#if !defined(__WIN__) && !defined(OS2) typedef off_t os_off_t; #endif +#if defined(__WIN__) +#define socket_errno WSAGetLastError() +#define SOCKET_EINTR WSAEINTR +#define SOCKET_EAGAIN WSAEINPROGRESS +#define SOCKET_ENFILE ENFILE +#define SOCKET_EMFILE EMFILE +#elif defined(OS2) +#define socket_errno sock_errno() +#define SOCKET_EINTR SOCEINTR +#define SOCKET_EAGAIN SOCEINPROGRESS +#define SOCKET_EWOULDBLOCK SOCEWOULDBLOCK +#define SOCKET_ENFILE SOCENFILE +#define SOCKET_EMFILE SOCEMFILE +#define closesocket(A) soclose(A) +#else /* Unix */ +#define socket_errno errno +#define closesocket(A) close(A) +#define SOCKET_EINTR EINTR +#define SOCKET_EAGAIN EAGAIN +#define SOCKET_EWOULDBLOCK EWOULDBLOCK +#define SOCKET_ENFILE ENFILE +#define SOCKET_EMFILE EMFILE +#endif + typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */ typedef short int15; /* Most effective integer 0 <= x <= 32767 */ typedef char *my_string; /* String of characters */ |