diff options
author | baker@bk-internal.mysql.com <> | 2006-11-28 22:22:52 +0100 |
---|---|---|
committer | baker@bk-internal.mysql.com <> | 2006-11-28 22:22:52 +0100 |
commit | f175a892abbf32669fb7760d6177097d99f3b7ec (patch) | |
tree | 17cbf7ddda5df51cd125e1aa56feb16b130192da /include | |
parent | 16b79adf39158a3a029d3f9bb77144c8c12f2313 (diff) | |
parent | 9de58810eb7eb159e08a3b5873c3e4d9321d9622 (diff) | |
download | mariadb-git-f175a892abbf32669fb7760d6177097d99f3b7ec.tar.gz |
Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
Diffstat (limited to 'include')
-rw-r--r-- | include/errmsg.h | 3 | ||||
-rw-r--r-- | include/my_global.h | 21 |
2 files changed, 20 insertions, 4 deletions
diff --git a/include/errmsg.h b/include/errmsg.h index dc7adb3b501..f24ea2bf396 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -95,6 +95,7 @@ extern const char *client_errors[]; /* Error messages */ #define CR_NO_STMT_METADATA 2052 #define CR_NO_RESULT_SET 2053 #define CR_NOT_IMPLEMENTED 2054 -#define CR_ERROR_LAST /*Copy last error nr:*/ 2054 +#define CR_SERVER_LOST_EXTENDED 2055 +#define CR_ERROR_LAST /*Copy last error nr:*/ 2055 /* Add error numbers before CR_ERROR_LAST and change it accordingly. */ diff --git a/include/my_global.h b/include/my_global.h index a7ec41068b3..c182ef7b799 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -869,9 +869,8 @@ typedef long my_ptrdiff_t; typedef long long my_ptrdiff_t; #endif -#if HAVE_SIZE_T -typedef size_t my_size_t; -#elif SIZEOF_CHARP <= SIZEOF_LONG +/* We can't set my_size_t to size_t as we want my_size_t to be unsigned */ +#if SIZEOF_CHARP <= SIZEOF_LONG typedef unsigned long my_size_t; #else typedef unsigned long long my_size_t; @@ -886,6 +885,22 @@ typedef unsigned long long my_size_t; #define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size) #define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B)) +/* + Custom version of standard offsetof() macro which can be used to get + offsets of members in class for non-POD types (according to the current + version of C++ standard offsetof() macro can't be used in such cases and + attempt to do so causes warnings to be emitted, OTOH in many cases it is + still OK to assume that all instances of the class has the same offsets + for the same members). + + This is temporary solution which should be removed once File_parser class + and related routines are refactored. +*/ + +#define my_offsetof(TYPE, MEMBER) \ + ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10)) + + #define NullS (char *) 0 /* Nowdays we do not support MessyDos */ #ifndef NEAR |