571
571
#undef remove /* Crashes MySQL on SCO 5.0.0 */
572
572
#define closesocket(A) close(A)
573
#ifndef ulonglong2double
574
#define ulonglong2double(A) ((double) (ulonglong) (A))
573
#ifndef uint64_t2double
574
#define uint64_t2double(A) ((double) (uint64_t) (A))
575
575
#define my_off_t2double(A) ((double) (my_off_t) (A))
758
758
[unsigned] long long unconditionally in many places,
759
759
for example in constants with [U]LL suffix.
761
typedef uint64_t ulonglong; /* ulong or unsigned long long */
762
761
typedef int64_t longlong;
866
865
#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
867
866
#endif /* HAVE_purify */
868
867
#define uint4korr(A) (*((uint32 *) (A)))
869
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
868
#define uint5korr(A) ((uint64_t)(((uint32) ((uchar) (A)[0])) +\
870
869
(((uint32) ((uchar) (A)[1])) << 8) +\
871
870
(((uint32) ((uchar) (A)[2])) << 16) +\
872
871
(((uint32) ((uchar) (A)[3])) << 24)) +\
873
(((ulonglong) ((uchar) (A)[4])) << 32))
874
#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \
872
(((uint64_t) ((uchar) (A)[4])) << 32))
873
#define uint6korr(A) ((uint64_t)(((uint32) ((uchar) (A)[0])) + \
875
874
(((uint32) ((uchar) (A)[1])) << 8) + \
876
875
(((uint32) ((uchar) (A)[2])) << 16) + \
877
876
(((uint32) ((uchar) (A)[3])) << 24)) + \
878
(((ulonglong) ((uchar) (A)[4])) << 32) + \
879
(((ulonglong) ((uchar) (A)[5])) << 40))
880
#define uint8korr(A) (*((ulonglong *) (A)))
877
(((uint64_t) ((uchar) (A)[4])) << 32) + \
878
(((uint64_t) ((uchar) (A)[5])) << 40))
879
#define uint8korr(A) (*((uint64_t *) (A)))
881
880
#define sint8korr(A) (*((longlong *) (A)))
882
881
#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
883
882
#define int3store(T,A) do { *(T)= (uchar) ((A));\
895
894
*((T)+3)=(uchar) (((A) >> 24)); \
896
895
*((T)+4)=(uchar) (((A) >> 32)); \
897
896
*((T)+5)=(uchar) (((A) >> 40)); } while(0)
898
#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
897
#define int8store(T,A) *((uint64_t *) (T))= (uint64_t) (A)
945
944
(((uint32) ((uchar) (A)[1])) << 8) +\
946
945
(((uint32) ((uchar) (A)[2])) << 16) +\
947
946
(((uint32) ((uchar) (A)[3])) << 24))
948
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
947
#define uint5korr(A) ((uint64_t)(((uint32) ((uchar) (A)[0])) +\
949
948
(((uint32) ((uchar) (A)[1])) << 8) +\
950
949
(((uint32) ((uchar) (A)[2])) << 16) +\
951
950
(((uint32) ((uchar) (A)[3])) << 24)) +\
952
(((ulonglong) ((uchar) (A)[4])) << 32))
953
#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \
951
(((uint64_t) ((uchar) (A)[4])) << 32))
952
#define uint6korr(A) ((uint64_t)(((uint32) ((uchar) (A)[0])) + \
954
953
(((uint32) ((uchar) (A)[1])) << 8) + \
955
954
(((uint32) ((uchar) (A)[2])) << 16) + \
956
955
(((uint32) ((uchar) (A)[3])) << 24)) + \
957
(((ulonglong) ((uchar) (A)[4])) << 32) + \
958
(((ulonglong) ((uchar) (A)[5])) << 40))
959
#define uint8korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
956
(((uint64_t) ((uchar) (A)[4])) << 32) + \
957
(((uint64_t) ((uchar) (A)[5])) << 40))
958
#define uint8korr(A) ((uint64_t)(((uint32) ((uchar) (A)[0])) +\
960
959
(((uint32) ((uchar) (A)[1])) << 8) +\
961
960
(((uint32) ((uchar) (A)[2])) << 16) +\
962
961
(((uint32) ((uchar) (A)[3])) << 24)) +\
963
(((ulonglong) (((uint32) ((uchar) (A)[4])) +\
962
(((uint64_t) (((uint32) ((uchar) (A)[4])) +\
964
963
(((uint32) ((uchar) (A)[5])) << 8) +\
965
964
(((uint32) ((uchar) (A)[6])) << 16) +\
966
965
(((uint32) ((uchar) (A)[7])) << 24))) <<\
1101
1100
#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*)(&V),sizeof(float))
1102
1101
#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
1103
1102
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
1104
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong))
1105
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong))
1103
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(uint64_t))
1104
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(uint64_t))
1120
1119
#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
1121
1120
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
1122
1121
#endif /* doubleget */
1123
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong))
1124
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong))
1122
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(uint64_t))
1123
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(uint64_t))
1126
1125
#endif /* WORDS_BIGENDIAN */