-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gulilan
committed
Apr 7, 2013
1 parent
55d830f
commit 6214ea5
Showing
75 changed files
with
21,569 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; version 2 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */ | ||
|
||
/* | ||
Data in big-endian format. | ||
*/ | ||
#define float4store(T,A) do { *(T)= ((uchar *) &A)[3];\ | ||
*((T)+1)=(char) ((uchar *) &A)[2];\ | ||
*((T)+2)=(char) ((uchar *) &A)[1];\ | ||
*((T)+3)=(char) ((uchar *) &A)[0]; } while(0) | ||
|
||
#define float4get(V,M) do { float def_temp;\ | ||
((uchar*) &def_temp)[0]=(M)[3];\ | ||
((uchar*) &def_temp)[1]=(M)[2];\ | ||
((uchar*) &def_temp)[2]=(M)[1];\ | ||
((uchar*) &def_temp)[3]=(M)[0];\ | ||
(V)=def_temp; } while(0) | ||
|
||
#define float8store(T,V) do { *(T)= ((uchar *) &V)[7];\ | ||
*((T)+1)=(char) ((uchar *) &V)[6];\ | ||
*((T)+2)=(char) ((uchar *) &V)[5];\ | ||
*((T)+3)=(char) ((uchar *) &V)[4];\ | ||
*((T)+4)=(char) ((uchar *) &V)[3];\ | ||
*((T)+5)=(char) ((uchar *) &V)[2];\ | ||
*((T)+6)=(char) ((uchar *) &V)[1];\ | ||
*((T)+7)=(char) ((uchar *) &V)[0]; } while(0) | ||
|
||
#define float8get(V,M) do { double def_temp;\ | ||
((uchar*) &def_temp)[0]=(M)[7];\ | ||
((uchar*) &def_temp)[1]=(M)[6];\ | ||
((uchar*) &def_temp)[2]=(M)[5];\ | ||
((uchar*) &def_temp)[3]=(M)[4];\ | ||
((uchar*) &def_temp)[4]=(M)[3];\ | ||
((uchar*) &def_temp)[5]=(M)[2];\ | ||
((uchar*) &def_temp)[6]=(M)[1];\ | ||
((uchar*) &def_temp)[7]=(M)[0];\ | ||
(V) = def_temp; } while(0) | ||
|
||
#define ushortget(V,M) do { V = (uint16) (((uint16) ((uchar) (M)[1]))+\ | ||
((uint16) ((uint16) (M)[0]) << 8)); } while(0) | ||
#define shortget(V,M) do { V = (short) (((short) ((uchar) (M)[1]))+\ | ||
((short) ((short) (M)[0]) << 8)); } while(0) | ||
#define longget(V,M) do { int32 def_temp;\ | ||
((uchar*) &def_temp)[0]=(M)[0];\ | ||
((uchar*) &def_temp)[1]=(M)[1];\ | ||
((uchar*) &def_temp)[2]=(M)[2];\ | ||
((uchar*) &def_temp)[3]=(M)[3];\ | ||
(V)=def_temp; } while(0) | ||
#define ulongget(V,M) do { uint32 def_temp;\ | ||
((uchar*) &def_temp)[0]=(M)[0];\ | ||
((uchar*) &def_temp)[1]=(M)[1];\ | ||
((uchar*) &def_temp)[2]=(M)[2];\ | ||
((uchar*) &def_temp)[3]=(M)[3];\ | ||
(V)=def_temp; } while(0) | ||
#define shortstore(T,A) do { uint def_temp=(uint) (A) ;\ | ||
*(((char*)T)+1)=(char)(def_temp); \ | ||
*(((char*)T)+0)=(char)(def_temp >> 8); } while(0) | ||
#define longstore(T,A) do { *(((char*)T)+3)=((A));\ | ||
*(((char*)T)+2)=(((A) >> 8));\ | ||
*(((char*)T)+1)=(((A) >> 16));\ | ||
*(((char*)T)+0)=(((A) >> 24)); } while(0) | ||
|
||
#define floatget(V,M) memcpy(&V, (M), sizeof(float)) | ||
/* Cast away type qualifiers (necessary as macro takes argument by value). */ | ||
#define floatstore(T,V) memcpy((T), (void*) (&V), sizeof(float)) | ||
#define doubleget(V,M) memcpy(&V, (M), sizeof(double)) | ||
/* Cast away type qualifiers (necessary as macro takes argument by value). */ | ||
#define doublestore(T,V) memcpy((T), (void*) &V, sizeof(double)) | ||
#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong)) | ||
#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong)) |
95 changes: 95 additions & 0 deletions
95
WinRadius/3rd-lib/MySQL-Server-5.6/include/byte_order_generic.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; version 2 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */ | ||
|
||
/* | ||
Endianness-independent definitions for architectures other | ||
than the x86 architecture. | ||
*/ | ||
#define sint2korr(A) (int16) (((int16) ((uchar) (A)[0])) +\ | ||
((int16) ((int16) (A)[1]) << 8)) | ||
#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) (int32) (((int32) ((uchar) (A)[0])) +\ | ||
(((int32) ((uchar) (A)[1]) << 8)) +\ | ||
(((int32) ((uchar) (A)[2]) << 16)) +\ | ||
(((int32) ((int16) (A)[3]) << 24))) | ||
#define sint8korr(A) (longlong) uint8korr(A) | ||
#define uint2korr(A) (uint16) (((uint16) ((uchar) (A)[0])) +\ | ||
((uint16) ((uchar) (A)[1]) << 8)) | ||
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ | ||
(((uint32) ((uchar) (A)[1])) << 8) +\ | ||
(((uint32) ((uchar) (A)[2])) << 16)) | ||
#define uint4korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ | ||
(((uint32) ((uchar) (A)[1])) << 8) +\ | ||
(((uint32) ((uchar) (A)[2])) << 16) +\ | ||
(((uint32) ((uchar) (A)[3])) << 24)) | ||
#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)(((uint32) ((uchar) (A)[0])) +\ | ||
(((uint32) ((uchar) (A)[1])) << 8) +\ | ||
(((uint32) ((uchar) (A)[2])) << 16) +\ | ||
(((uint32) ((uchar) (A)[3])) << 24)) +\ | ||
(((ulonglong) (((uint32) ((uchar) (A)[4])) +\ | ||
(((uint32) ((uchar) (A)[5])) << 8) +\ | ||
(((uint32) ((uchar) (A)[6])) << 16) +\ | ||
(((uint32) ((uchar) (A)[7])) << 24))) <<\ | ||
32)) | ||
#define int2store(T,A) do { uint def_temp= (uint) (A) ;\ | ||
*((uchar*) (T))= (uchar)(def_temp); \ | ||
*((uchar*) (T)+1)=(uchar)((def_temp >> 8)); \ | ||
} while(0) | ||
#define int3store(T,A) do { /*lint -save -e734 */\ | ||
*((uchar*)(T))=(uchar) ((A));\ | ||
*((uchar*) (T)+1)=(uchar) (((A) >> 8));\ | ||
*((uchar*)(T)+2)=(uchar) (((A) >> 16)); \ | ||
/*lint -restore */} while(0) | ||
#define int4store(T,A) do { *((char *)(T))=(char) ((A));\ | ||
*(((char *)(T))+1)=(char) (((A) >> 8));\ | ||
*(((char *)(T))+2)=(char) (((A) >> 16));\ | ||
*(((char *)(T))+3)=(char) (((A) >> 24));\ | ||
} while(0) | ||
#define int5store(T,A) do { *((char *)(T))= (char)((A)); \ | ||
*(((char *)(T))+1)= (char)(((A) >> 8)); \ | ||
*(((char *)(T))+2)= (char)(((A) >> 16)); \ | ||
*(((char *)(T))+3)= (char)(((A) >> 24)); \ | ||
*(((char *)(T))+4)= (char)(((A) >> 32)); \ | ||
} while(0) | ||
#define int6store(T,A) do { *((char *)(T))= (char)((A)); \ | ||
*(((char *)(T))+1)= (char)(((A) >> 8)); \ | ||
*(((char *)(T))+2)= (char)(((A) >> 16)); \ | ||
*(((char *)(T))+3)= (char)(((A) >> 24)); \ | ||
*(((char *)(T))+4)= (char)(((A) >> 32)); \ | ||
*(((char *)(T))+5)= (char)(((A) >> 40)); \ | ||
} while(0) | ||
#define int8store(T,A) do { uint def_temp= (uint) (A), \ | ||
def_temp2= (uint) ((A) >> 32); \ | ||
int4store((T),def_temp); \ | ||
int4store((T+4),def_temp2);\ | ||
} while(0) |
93 changes: 93 additions & 0 deletions
93
WinRadius/3rd-lib/MySQL-Server-5.6/include/byte_order_generic_x86.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; version 2 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */ | ||
|
||
/* | ||
Optimized function-like macros for the x86 architecture (_WIN32 included). | ||
*/ | ||
#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. | ||
*/ | ||
#if defined(HAVE_purify) && !defined(_WIN32) | ||
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ | ||
(((uint32) ((uchar) (A)[1])) << 8) +\ | ||
(((uint32) ((uchar) (A)[2])) << 16)) | ||
#else | ||
#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) | ||
#endif | ||
#define uint4korr(A) (*((uint32 *) (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) do { *(T)= (uchar) ((A));\ | ||
*(T+1)=(uchar) (((uint) (A) >> 8));\ | ||
*(T+2)=(uchar) (((A) >> 16));\ | ||
} while (0) | ||
#define int4store(T,A) *((long *) (T))= (long) (A) | ||
#define int5store(T,A) do { *(T)= (uchar)((A));\ | ||
*((T)+1)=(uchar) (((A) >> 8));\ | ||
*((T)+2)=(uchar) (((A) >> 16));\ | ||
*((T)+3)=(uchar) (((A) >> 24));\ | ||
*((T)+4)=(uchar) (((A) >> 32));\ | ||
} while(0) | ||
#define int6store(T,A) do { *(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)); \ | ||
} while(0) | ||
#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) | ||
typedef union { | ||
double v; | ||
long m[2]; | ||
} doubleget_union; | ||
#define doubleget(V,M) do { doubleget_union _tmp; \ | ||
_tmp.m[0] = *((long*)(M)); \ | ||
_tmp.m[1] = *(((long*) (M))+1); \ | ||
(V) = _tmp.v;\ | ||
} while(0) | ||
#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \ | ||
*(((long *) T)+1) = ((doubleget_union *)&V)->m[1];\ | ||
} while (0) | ||
#define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while(0) | ||
#define float8get(V,M) doubleget((V),(M)) | ||
#define float4store(V,M) memcpy((uchar*)(V), (uchar*)(&M), sizeof(float)) | ||
#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)) |
84 changes: 84 additions & 0 deletions
84
WinRadius/3rd-lib/MySQL-Server-5.6/include/byte_order_generic_x86_64.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; version 2 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */ | ||
|
||
/* | ||
Optimized function-like macros for the x86 architecture (_WIN32 included). | ||
*/ | ||
#define sint2korr(A) (int16) (*((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) (int32) (*((int32 *) (A))) | ||
#define uint2korr(A) (uint16) (*((uint16 *) (A))) | ||
/* | ||
Attention: Please, note, uint3korr reads 4 bytes (not 3)! | ||
It means, that you have to provide enough allocated space. | ||
*/ | ||
#if defined(HAVE_purify) && !defined(_WIN32) | ||
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ | ||
(((uint32) ((uchar) (A)[1])) << 8) +\ | ||
(((uint32) ((uchar) (A)[2])) << 16)) | ||
#else | ||
#define uint3korr(A) (uint32) (*((unsigned int *) (A)) & 0xFFFFFF) | ||
#endif | ||
#define uint4korr(A) (uint32) (*((uint32 *) (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) (*((ulonglong *) (A))) | ||
#define sint8korr(A) (longlong) (*((longlong *) (A))) | ||
|
||
#define int2store(T,A) do { uchar *pT= (uchar*)(T);\ | ||
*((uint16*)(pT))= (uint16) (A);\ | ||
} while (0) | ||
|
||
#define int3store(T,A) do { *(T)= (uchar) ((A));\ | ||
*(T+1)=(uchar) (((uint) (A) >> 8));\ | ||
*(T+2)=(uchar) (((A) >> 16));\ | ||
} while (0) | ||
#define int4store(T,A) do { uchar *pT= (uchar*)(T);\ | ||
*((uint32 *) (pT))= (uint32) (A); \ | ||
} while (0) | ||
|
||
#define int5store(T,A) do { *(T)= (uchar)((A));\ | ||
*((T)+1)=(uchar) (((A) >> 8));\ | ||
*((T)+2)=(uchar) (((A) >> 16));\ | ||
*((T)+3)=(uchar) (((A) >> 24));\ | ||
*((T)+4)=(uchar) (((A) >> 32));\ | ||
} while(0) | ||
#define int6store(T,A) do { *(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)); \ | ||
} while(0) | ||
#define int8store(T,A) do { uchar *pT= (uchar*)(T);\ | ||
*((ulonglong *) (pT))= (ulonglong) (A);\ | ||
} while(0) | ||
|
Oops, something went wrong.