diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-03-24 12:30:03 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-03-24 12:30:03 +0100 |
commit | 8250ceced6aab95347e00e2ff1c02730da0be4fe (patch) | |
tree | a9c92cf8c685457bf79b580ab6109e6331e8c300 /sql/field.h | |
parent | a85ccfedcf91f7ad2c578ec60e69d127f199d079 (diff) | |
download | mariadb-git-8250ceced6aab95347e00e2ff1c02730da0be4fe.tar.gz |
Fix compilation on Windows:
- Fixes for type-conversion
(time_t is not interchangeable with my_time_t on Windows as time_t s 64 bit while my_time_t is long)
- BIGENDIAN-> ARCH_BIGENDIAN .
BIGENDIAN constant is defined in winsock2.h (as 0)
- added explicit cast for longlong->double conversion in sql/item.h (fixed many warnings)
Also, HAVE_SNPRINTF is now defined and snprintf is defined to _snprintf in config-win.h
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sql/field.h b/sql/field.h index f40a4e2fb3c..8eacfcd404f 100644 --- a/sql/field.h +++ b/sql/field.h @@ -22,10 +22,10 @@ #pragma interface /* gcc class implementation */ #endif -#ifdef WORDS_BIGENDIAN -#define BIGENDIAN 1 +#ifdef WORDS_ARCH_BIGENDIAN +#define ARCH_BIGENDIAN 1 #else -#define BIGENDIAN 0 +#define ARCH_BIGENDIAN 0 #endif #define NOT_FIXED_DEC 31 @@ -548,12 +548,12 @@ protected: bool low_byte_first_from, bool low_byte_first_to) { int32 val; - if (BIGENDIAN && low_byte_first_from) + if (ARCH_BIGENDIAN && low_byte_first_from) val = sint4korr(from); else longget(val, from); - if (BIGENDIAN && low_byte_first_to) + if (ARCH_BIGENDIAN && low_byte_first_to) int4store(to, val); else longstore(to, val); @@ -566,12 +566,12 @@ protected: bool low_byte_first_from, bool low_byte_first_to) { int64 val; - if (BIGENDIAN && low_byte_first_from) + if (ARCH_BIGENDIAN && low_byte_first_from) val = sint8korr(from); else longlongget(val, from); - if (BIGENDIAN && low_byte_first_to) + if (ARCH_BIGENDIAN && low_byte_first_to) int8store(to, val); else longlongstore(to, val); @@ -883,12 +883,12 @@ public: uint max_length, bool low_byte_first) { int16 val; - if (BIGENDIAN && table->s->db_low_byte_first) + if (ARCH_BIGENDIAN && table->s->db_low_byte_first) val = sint2korr(from); else shortget(val, from); - if (BIGENDIAN && low_byte_first) + if (ARCH_BIGENDIAN && low_byte_first) int2store(to, val); else shortstore(to, val); @@ -899,12 +899,12 @@ public: uint param_data, bool low_byte_first) { int16 val; - if (BIGENDIAN && low_byte_first) + if (ARCH_BIGENDIAN && low_byte_first) val = sint2korr(from); else shortget(val, from); - if (BIGENDIAN && table->s->db_low_byte_first) + if (ARCH_BIGENDIAN && table->s->db_low_byte_first) int2store(to, val); else shortstore(to, val); @@ -1200,7 +1200,7 @@ public: virtual long get_timestamp(ulong *sec_part) const; virtual void store_TIME(my_time_t timestamp, ulong sec_part) { - if (BIGENDIAN && table && table->s->db_low_byte_first) + if (ARCH_BIGENDIAN && table && table->s->db_low_byte_first) int4store(ptr,timestamp); else longstore(ptr,(uint32) timestamp); |