summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <joerg@trift2.>2008-03-27 12:45:16 +0100
committerunknown <joerg@trift2.>2008-03-27 12:45:16 +0100
commit797a2d68f81bc931170d71d066d204c4071653b6 (patch)
treead0f3904109b50a452c4e481659cd1eec465d3e9 /include
parent321f392f629479eedf63062f85283e911ce05d7e (diff)
parentdb9df4c725c5b9b8ed35a965fdd4a8b0a8278e0a (diff)
downloadmariadb-git-797a2d68f81bc931170d71d066d204c4071653b6.tar.gz
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1 configure.in: Auto merged mysql-test/r/federated.result: Auto merged mysql-test/t/federated.test: Auto merged
Diffstat (limited to 'include')
-rw-r--r--include/config-win.h65
-rw-r--r--include/my_global.h11
2 files changed, 5 insertions, 71 deletions
diff --git a/include/config-win.h b/include/config-win.h
index e0558ca4564..170b4b451c7 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -260,71 +260,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 uint6korr(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) + \
- (((ulonglong) ((uchar) (A)[5])) << 40))
-#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 int6store(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)); \
- *((T)+5)=(uchar) (((A) >> 40)); }
-#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((uchar*)(T), (uchar*)(&V), sizeof(float))
-#define floatget(V,M) memcpy((uchar*)(&V), (uchar*)(M), sizeof(float))
-#define float8get(V,M) doubleget((V),(M))
-#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&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 bc96ad65aee..00d1ea25c7a 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1140,7 +1140,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) | \
@@ -1152,7 +1152,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))
@@ -1164,7 +1164,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) +\
@@ -1215,9 +1215,8 @@ do { doubleget_union _tmp; \
#define floatstore(T,V) memcpy((uchar*)(T), (uchar*)(&V),sizeof(float))
#define floatget(V,M) memcpy((uchar*) &V,(uchar*) (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)
@@ -1356,7 +1355,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)