mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Check that __FLOAT_WORD_ORDER is defined
This commit is contained in:
@ -812,7 +812,7 @@ typedef union {
|
|||||||
#define float4get(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float))
|
#define float4get(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float))
|
||||||
#define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float))
|
#define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float))
|
||||||
|
|
||||||
#if (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
||||||
#define doublestore(T,V) { *(T)= ((byte *) &V)[4];\
|
#define doublestore(T,V) { *(T)= ((byte *) &V)[4];\
|
||||||
*((T)+1)=(char) ((byte *) &V)[5];\
|
*((T)+1)=(char) ((byte *) &V)[5];\
|
||||||
*((T)+2)=(char) ((byte *) &V)[6];\
|
*((T)+2)=(char) ((byte *) &V)[6];\
|
||||||
|
@ -167,7 +167,7 @@
|
|||||||
((byte*) &def_temp)[3]=(M)[0];\
|
((byte*) &def_temp)[3]=(M)[0];\
|
||||||
(V)=def_temp; }
|
(V)=def_temp; }
|
||||||
|
|
||||||
#if (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
||||||
#define mi_float8store(T,V) { *(T)= ((byte *) &V)[3];\
|
#define mi_float8store(T,V) { *(T)= ((byte *) &V)[3];\
|
||||||
*((T)+1)=(char) ((byte *) &V)[2];\
|
*((T)+1)=(char) ((byte *) &V)[2];\
|
||||||
*((T)+2)=(char) ((byte *) &V)[1];\
|
*((T)+2)=(char) ((byte *) &V)[1];\
|
||||||
|
@ -2107,7 +2107,7 @@ int Field_double::cmp(const char *a_ptr, const char *b_ptr)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* could this ALWAYS be 2 calls to doubleget() ?? */
|
/* could this ALWAYS be 2 calls to doubleget() ?? */
|
||||||
#if (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
||||||
doubleget(a, a_ptr);
|
doubleget(a, a_ptr);
|
||||||
doubleget(b, b_ptr);
|
doubleget(b, b_ptr);
|
||||||
#else
|
#else
|
||||||
@ -2134,7 +2134,7 @@ void Field_double::sort_string(char *to,uint length __attribute__((unused)))
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
/* could this ALWAYS be 2 calls to doubleget() ?? */
|
/* could this ALWAYS be 2 calls to doubleget() ?? */
|
||||||
#if (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
||||||
doubleget(nr,ptr);
|
doubleget(nr,ptr);
|
||||||
#else
|
#else
|
||||||
memcpy_fixed(&nr,ptr,sizeof(nr));
|
memcpy_fixed(&nr,ptr,sizeof(nr));
|
||||||
|
@ -932,7 +932,7 @@ void change_double_for_sort(double nr,byte *to)
|
|||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
uchar *ptr= (uchar*) &nr;
|
uchar *ptr= (uchar*) &nr;
|
||||||
#if (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
||||||
tmp[0]= ptr[3]; tmp[1]=ptr[2]; tmp[2]= ptr[1]; tmp[3]=ptr[0];
|
tmp[0]= ptr[3]; tmp[1]=ptr[2]; tmp[2]= ptr[1]; tmp[3]=ptr[0];
|
||||||
tmp[4]= ptr[7]; tmp[5]=ptr[6]; tmp[6]= ptr[5]; tmp[7]=ptr[4];
|
tmp[4]= ptr[7]; tmp[5]=ptr[6]; tmp[6]= ptr[5]; tmp[7]=ptr[4];
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user