MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Ignacio Galarza Date:February 27 2008 9:17pm
Subject:bk commit into 5.0 tree (iggy:1.2588) BUG#23839
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of iggy.  When iggy does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-02-27 16:17:05-05:00, iggy@alf.(none) +3 -0
  Bug #23839 Multiple declarations of macros
  - Remove duplicate macro defintions.

  CMakeLists.txt@stripped, 2008-02-27 16:17:00-05:00, iggy@alf.(none) +8 -0
    Bug #23839 Multiple declarations of macros
    - Make sure _WIN64 is defined for proper Intellisense functionality.

  include/config-win.h@stripped, 2008-02-27 16:17:01-05:00, iggy@alf.(none) +0 -54
    Bug #23839 Multiple declarations of macros
    - Remove extra definitions.  Use the my_global.h defines instead.

  include/my_global.h@stripped, 2008-02-27 16:17:03-05:00, iggy@alf.(none) +5 -6
    Bug #23839 Multiple declarations of macros
    - Slight change to maintain current definitions for Windows.

diff -Nrup a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	2007-11-02 15:16:44 -04:00
+++ b/CMakeLists.txt	2008-02-27 16:17:00 -05:00
@@ -125,6 +125,14 @@ ENDIF(CMAKE_GENERATOR MATCHES "Visual St
 
 ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
 
+# This definition is necessary to work around a bug with Intellisense described
+# here: http://tinyurl.com/2cb428.  Syntax highlighting is important for proper
+# debugger functionality.
+IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
+    MESSAGE(STATUS "Detected 64-bit platform.")
+    ADD_DEFINITIONS("-D_WIN64")
+ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)
+
 IF(EMBED_MANIFESTS)
     # Search for the tools (mt, makecat, signtool) necessary for embedding
     # manifests and signing executables with the MySQL AB authenticode cert.
diff -Nrup a/include/config-win.h b/include/config-win.h
--- a/include/config-win.h	2007-10-23 09:48:54 -04:00
+++ b/include/config-win.h	2008-02-27 16:17:01 -05:00
@@ -254,60 +254,6 @@ inline double ulonglong2double(ulonglong
 
 
 #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 -Nrup a/include/my_global.h b/include/my_global.h
--- a/include/my_global.h	2007-11-29 19:37:04 -05:00
+++ b/include/my_global.h	2008-02-27 16:17:03 -05:00
@@ -1053,7 +1053,7 @@ typedef char		bool;	/* Ordinary boolean 
 */
 
 /* Optimized store functions for Intel x86 */
-#if defined(__i386__) && !defined(_WIN64)
+#if defined(__i386__) || (defined(_WIN32) && !defined(_WIN64))
 #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 
 				  ((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 
     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 AND !_WIN64 */
 
 /*
   Macro for reading 32-bit integer from network byte order (big-endian)
Thread
bk commit into 5.0 tree (iggy:1.2588) BUG#23839Ignacio Galarza27 Feb