diff options
author | Chad MILLER <chad@mysql.com> | 2008-07-10 14:50:07 -0400 |
---|---|---|
committer | Chad MILLER <chad@mysql.com> | 2008-07-10 14:50:07 -0400 |
commit | c425bf421da9ffa55d3d568f70508fa12dd07aa0 (patch) | |
tree | 667c2782c7fcee247010d3413aaf80a81fc6dd92 /include | |
parent | 6a6e77eeffc7dbd72888ef685fdb93fc2ae7aed6 (diff) | |
parent | 0db1f520c629455b4766c3d8f57a9767d7f6a98f (diff) | |
download | mariadb-git-c425bf421da9ffa55d3d568f70508fa12dd07aa0.tar.gz |
Merge chunk from trunk.
Diffstat (limited to 'include')
-rw-r--r-- | include/config-win.h | 54 | ||||
-rw-r--r-- | include/my_global.h | 11 | ||||
-rw-r--r-- | include/my_pthread.h | 8 | ||||
-rw-r--r-- | include/sql_common.h | 1 |
4 files changed, 10 insertions, 64 deletions
diff --git a/include/config-win.h b/include/config-win.h index 923cf0592af..f3c48510494 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -257,60 +257,6 @@ inline double ulonglong2double(ulonglong value) #define STACK_DIRECTION -1 - -/* Optimized store functions for Intel x86 */ - -#ifndef _WIN64 -#define sint2korr(A) (*((int16 *) (A))) -#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ - (((uint32) 255L << 24) | \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0])) : \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (*((long *) (A))) -#define uint2korr(A) (*((uint16 *) (A))) -/* - ATTENTION ! - - Please, note, uint3korr reads 4 bytes (not 3) ! - It means, that you have to provide enough allocated space ! -*/ -#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) -#define uint4korr(A) (*((unsigned long *) (A))) -#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) +\ - (((ulonglong) ((uchar) (A)[4])) << 32)) -#define uint8korr(A) (*((ulonglong *) (A))) -#define sint8korr(A) (*((longlong *) (A))) -#define int2store(T,A) *((uint16*) (T))= (uint16) (A) -#define int3store(T,A) { *(T)= (uchar) ((A));\ - *(T+1)=(uchar) (((uint) (A) >> 8));\ - *(T+2)=(uchar) (((A) >> 16)); } -#define int4store(T,A) *((long *) (T))= (long) (A) -#define int5store(T,A) { *(T)= (uchar)((A));\ - *((T)+1)=(uchar) (((A) >> 8));\ - *((T)+2)=(uchar) (((A) >> 16));\ - *((T)+3)=(uchar) (((A) >> 24)); \ - *((T)+4)=(uchar) (((A) >> 32)); } -#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) - -#define doubleget(V,M) do { *((long *) &V) = *((long*) M); \ - *(((long *) &V)+1) = *(((long*) M)+1); } while(0) -#define doublestore(T,V) do { *((long *) T) = *((long*) &V); \ - *(((long *) T)+1) = *(((long*) &V)+1); } while(0) -#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); } -#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float)) -#define floatget(V,M) memcpy((byte*)(&V), (byte*)(M), sizeof(float)) -#define float8get(V,M) doubleget((V),(M)) -#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) -#define float8store(V,M) doublestore((V),(M)) -#endif /* _WIN64 */ - #define HAVE_PERROR #define HAVE_VFPRINT #define HAVE_RENAME /* Have rename() as function */ diff --git a/include/my_global.h b/include/my_global.h index 08877300d8a..f290b690630 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1053,7 +1053,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */ */ /* Optimized store functions for Intel x86 */ -#if defined(__i386__) && !defined(_WIN64) +#if defined(__i386__) || defined(_WIN32) #define sint2korr(A) (*((int16 *) (A))) #define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ (((uint32) 255L << 24) | \ @@ -1065,7 +1065,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */ ((uint32) (uchar) (A)[0]))) #define sint4korr(A) (*((long *) (A))) #define uint2korr(A) (*((uint16 *) (A))) -#ifdef HAVE_purify +#if defined(HAVE_purify) && !defined(_WIN32) #define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ (((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) ((uchar) (A)[2])) << 16)) @@ -1077,7 +1077,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */ It means, that you have to provide enough allocated space ! */ #define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) -#endif +#endif /* HAVE_purify && !_WIN32 */ #define uint4korr(A) (*((uint32 *) (A))) #define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ (((uint32) ((uchar) (A)[1])) << 8) +\ @@ -1116,9 +1116,8 @@ do { doubleget_union _tmp; \ #define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float)) #define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float)) #define float8store(V,M) doublestore((V),(M)) -#endif /* __i386__ */ +#else -#ifndef sint2korr /* We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines were done before) @@ -1243,7 +1242,7 @@ do { doubleget_union _tmp; \ #define float8store(V,M) doublestore((V),(M)) #endif /* WORDS_BIGENDIAN */ -#endif /* sint2korr */ +#endif /* __i386__ OR _WIN32 */ /* Macro for reading 32-bit integer from network byte order (big-endian) diff --git a/include/my_pthread.h b/include/my_pthread.h index 13b7cf93d6f..51202d6665e 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -181,7 +181,7 @@ extern int pthread_mutex_destroy (pthread_mutex_t *); #define pthread_mutex_unlock(A) LeaveCriticalSection(A) #define pthread_mutex_destroy(A) DeleteCriticalSection(A) #define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B)) -#define pthread_kill(A,B) pthread_dummy(ESRCH) +#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) #endif /* OS2 */ /* Dummy defines for easier code */ @@ -445,14 +445,14 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #define pthread_attr_setdetachstate(A,B) pthread_dummy(0) #define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define pthread_kill(A,B) pthread_dummy(ESRCH) +#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) #undef pthread_detach_this_thread #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } #endif #ifdef HAVE_DARWIN5_THREADS #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define pthread_kill(A,B) pthread_dummy(ESRCH) +#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) #define pthread_condattr_init(A) pthread_dummy(0) #define pthread_condattr_destroy(A) pthread_dummy(0) #undef pthread_detach_this_thread @@ -472,7 +472,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #ifndef pthread_sigmask #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #endif -#define pthread_kill(A,B) pthread_dummy(ESRCH) +#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) #undef pthread_detach_this_thread #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } #elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ diff --git a/include/sql_common.h b/include/sql_common.h index a549fe6aeb5..32487f7e569 100644 --- a/include/sql_common.h +++ b/include/sql_common.h @@ -15,6 +15,7 @@ extern const char *unknown_sqlstate; +extern const char *cant_connect_sqlstate; extern const char *not_error_sqlstate; #ifdef __cplusplus |