summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/errmsg.h41
-rw-r--r--include/my_alloc.h3
-rw-r--r--include/my_base.h2
-rw-r--r--include/my_global.h36
-rw-r--r--include/my_net.h4
-rw-r--r--include/my_pthread.h2
-rw-r--r--include/my_tree.h4
-rw-r--r--include/myisam.h2
-rw-r--r--include/myisampack.h2
-rw-r--r--include/queues.h5
-rw-r--r--include/violite.h3
11 files changed, 61 insertions, 43 deletions
diff --git a/include/errmsg.h b/include/errmsg.h
index 5ac5ef9a4a7..703395a3742 100644
--- a/include/errmsg.h
+++ b/include/errmsg.h
@@ -61,26 +61,27 @@ extern const char *client_errors[]; /* Error messages */
#define CR_PROBE_SLAVE_HOSTS 2023
#define CR_PROBE_SLAVE_CONNECT 2024
#define CR_PROBE_MASTER_CONNECT 2025
+#define CR_SSL_CONNECTION_ERROR 2026
/* new 4.1 error codes */
-#define CR_INVALID_CONN_HANDLE 2026
-#define CR_NULL_POINTER 2027
-#define CR_NO_PREPARE_STMT 2028
-#define CR_NOT_ALL_PARAMS_BOUND 2029
-#define CR_DATA_TRUNCATED 2030
-#define CR_NO_PARAMETERS_EXISTS 2031
-#define CR_INVALID_PARAMETER_NO 2032
-#define CR_INVALID_BUFFER_USE 2033
-#define CR_UNSUPPORTED_PARAM_TYPE 2034
+#define CR_INVALID_CONN_HANDLE 2027
+#define CR_NULL_POINTER 2028
+#define CR_NO_PREPARE_STMT 2029
+#define CR_NOT_ALL_PARAMS_BOUND 2030
+#define CR_DATA_TRUNCATED 2031
+#define CR_NO_PARAMETERS_EXISTS 2032
+#define CR_INVALID_PARAMETER_NO 2033
+#define CR_INVALID_BUFFER_USE 2034
+#define CR_UNSUPPORTED_PARAM_TYPE 2035
-#define CR_SHARED_MEMORY_CONNECTION 2035
-#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2036
-#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2037
-#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2038
-#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2039
-#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2040
-#define CR_SHARED_MEMORY_MAP_ERROR 2041
-#define CR_SHARED_MEMORY_EVENT_ERROR 2042
-#define CR_SHARED_MEMORY_CONNECT_ABANDODED_ERROR 2043
-#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
-#define CR_CONN_UNKNOW_PROTOCOL 2048
+#define CR_SHARED_MEMORY_CONNECTION 2036
+#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2037
+#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2038
+#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2039
+#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2040
+#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2041
+#define CR_SHARED_MEMORY_MAP_ERROR 2042
+#define CR_SHARED_MEMORY_EVENT_ERROR 2043
+#define CR_SHARED_MEMORY_CONNECT_ABANDODED_ERROR 2044
+#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2045
+#define CR_CONN_UNKNOW_PROTOCOL 2046
diff --git a/include/my_alloc.h b/include/my_alloc.h
index 31f1fb7165f..a3dd35d7ea3 100644
--- a/include/my_alloc.h
+++ b/include/my_alloc.h
@@ -21,7 +21,8 @@
#ifndef _my_alloc_h
#define _my_alloc_h
-#define MAX_BLOCK_USAGE_BEFORE_DROP 10
+#define ALLOC_MAX_BLOCK_TO_DROP 4096
+#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
typedef struct st_used_mem
{ /* struct for once_alloc (block) */
diff --git a/include/my_base.h b/include/my_base.h
index 7e1df17b69d..b4e39952f22 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -301,8 +301,10 @@ enum data_file_type {
/* For number of records */
#ifdef BIG_TABLES
+#define rows2double(A) ulonglong2double(A)
typedef my_off_t ha_rows;
#else
+#define rows2double(A) (double) (A)
typedef ulong ha_rows;
#endif
diff --git a/include/my_global.h b/include/my_global.h
index d1b3c516555..749a326f86f 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -38,6 +38,14 @@
#define HAVE_ERRNO_AS_DEFINE
#endif /* __CYGWIN__ */
+/* Macros to make switching between C and C++ mode easier */
+#ifdef __cplusplus
+#define C_MODE_START extern "C" {
+#define C_MODE_END }
+#else
+#define C_MODE_START
+#define C_MODE_END
+#endif
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
#include <config-win.h>
@@ -119,7 +127,12 @@
#define _H_STRINGS
#define _SYS_STREAM_H
/* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */
-#endif
+#define ulonglong2double(A) my_ulonglong2double(A)
+#define my_off_t2double(A) my_ulonglong2double(A)
+C_MODE_START
+double my_ulonglong2double(unsigned long long A);
+C_MODE_END
+#endif /* _AIX */
#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */
#undef HAVE_SNPRINTF
@@ -128,6 +141,10 @@
#undef HAVE_PREAD
#undef HAVE_PWRITE
#endif
+#if defined(HAVE_BROKEN_INLINE) && !defined(__cplusplus)
+#undef inline
+#define inline
+#endif
#ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */
#undef HAVE_GETHOSTBYNAME_R
@@ -240,7 +257,7 @@
#ifdef DONT_USE_FINITE /* HPUX 11.x has is_finite() */
#undef HAVE_FINITE
#endif
-#if defined(HPUX) && defined(_LARGEFILE64_SOURCE) && defined(THREAD)
+#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD)
/* Fix bug in setrlimit */
#undef setrlimit
#define setrlimit cma_setrlimit64
@@ -376,7 +393,9 @@ typedef int my_socket; /* File descriptor for sockets */
#endif
/* Type for fuctions that handles signals */
#define sig_handler RETSIGTYPE
+C_MODE_START
typedef void (*sig_return)();/* Returns type from signal */
+C_MODE_END
#if defined(__GNUC__) && !defined(_lint)
typedef char pchar; /* Mixed prototypes can take char */
typedef char puchar; /* Mixed prototypes can take char */
@@ -390,8 +409,10 @@ typedef int pbool; /* Mixed prototypes can't take char */
typedef int pshort; /* Mixed prototypes can't take short int */
typedef double pfloat; /* Mixed prototypes can't take float */
#endif
+C_MODE_START
typedef int (*qsort_cmp)(const void *,const void *);
typedef int (*qsort_cmp2)(void*, const void *,const void *);
+C_MODE_END
#ifdef HAVE_mit_thread
#define qsort_t void
#undef QSORT_TYPE_IS_VOID
@@ -1029,13 +1050,4 @@ typedef union {
#define statistic_add(V,C,L) (V)+=(C)
#endif
-/* Macros to make switching between C and C++ mode easier */
-#ifdef __cplusplus
-#define C_MODE_START extern "C" {
-#define C_MODE_END }
-#else
-#define C_MODE_START
-#define C_MODE_END
-#endif
-
-#endif /* _global_h */
+#endif /* my_global_h */
diff --git a/include/my_net.h b/include/my_net.h
index 2f5743923cf..ec985ded76b 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -71,7 +71,7 @@ void my_inet_ntoa(struct in_addr in, char *buf);
Handling of gethostbyname_r()
*/
-#if !defined(HPUX)
+#if !defined(HPUX10)
struct hostent;
#endif /* HPUX */
#if !defined(HAVE_GETHOSTBYNAME_R)
@@ -84,7 +84,7 @@ struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
int buflen, int *h_errnop);
#define my_gethostbyname_r_free()
-#if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) && !defined(HPUX)
+#if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) && !defined(HPUX10)
#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
#endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 9b7812b7cf2..f75ca8f601a 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -428,7 +428,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res);
#endif /* defined(__WIN__) */
-#if defined(HPUX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
+#if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
#undef pthread_cond_timedwait
#define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c))
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
diff --git a/include/my_tree.h b/include/my_tree.h
index 99194907ef9..0e705e19bba 100644
--- a/include/my_tree.h
+++ b/include/my_tree.h
@@ -83,7 +83,6 @@ void *tree_search(TREE *tree, void *key, void *custom_arg);
int tree_walk(TREE *tree,tree_walk_action action,
void *argument, TREE_WALK visit);
int tree_delete(TREE *tree, void *key, void *custom_arg);
-
void *tree_search_key(TREE *tree, const void *key,
TREE_ELEMENT **parents, TREE_ELEMENT ***last_pos,
enum ha_rkey_function flag, void *custom_arg);
@@ -93,6 +92,9 @@ void *tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs,
int r_offs);
ha_rows tree_record_pos(TREE *tree, const void *key,
enum ha_rkey_function search_flag, void *custom_arg);
+
+#define TREE_ELEMENT_EXTRA_SIZE (sizeof(TREE_ELEMENT) + sizeof(void*))
+
#ifdef __cplusplus
}
#endif
diff --git a/include/myisam.h b/include/myisam.h
index acaf8bb7618..f11b18824d5 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -285,7 +285,7 @@ extern uint mi_get_pointer_length(ulonglong file_length, uint def);
#define T_VERBOSE (1L << 28)
#define T_VERY_SILENT (1L << 29)
#define T_WAIT_FOREVER (1L << 30)
-#define T_WRITE_LOOP (1L << 31)
+#define T_WRITE_LOOP ((ulong) 1L << 31)
#define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL)
diff --git a/include/myisampack.h b/include/myisampack.h
index 51c9876c246..95793e2aaeb 100644
--- a/include/myisampack.h
+++ b/include/myisampack.h
@@ -214,7 +214,7 @@
#ifdef BIG_TABLES
#define mi_rowstore(T,A) mi_int8store(T,A)
-#define mi_rowkorr(T) mi_uint8korr(T)
+#define mi_rowkorr(T) mi_uint8korr(T)
#else
#define mi_rowstore(T,A) { mi_int4store(T,0); mi_int4store(((T)+4),A); }
#define mi_rowkorr(T) mi_uint4korr((T)+4)
diff --git a/include/queues.h b/include/queues.h
index 70cb99a1513..699705d0869 100644
--- a/include/queues.h
+++ b/include/queues.h
@@ -41,12 +41,13 @@ typedef struct st_queue {
#define queue_element(queue,index) ((queue)->root[index+1])
#define queue_end(queue) ((queue)->root[(queue)->elements])
#define queue_replaced(queue) _downheap(queue,1)
+typedef int (*queue_compare)(void *,byte *, byte *);
int init_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
- pbool max_at_top, int (*compare)(void *,byte *, byte *),
+ pbool max_at_top, queue_compare compare,
void *first_cmp_arg);
int reinit_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
- pbool max_at_top, int (*compare)(void *,byte *, byte *),
+ pbool max_at_top, queue_compare compare,
void *first_cmp_arg);
void delete_queue(QUEUE *queue);
void queue_insert(QUEUE *queue,byte *element);
diff --git a/include/violite.h b/include/violite.h
index d73328b72be..b8bfb2183a2 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -188,7 +188,7 @@ struct st_VioSSLConnectorFd
SSL_METHOD* ssl_method_;
};
-void sslaccept(struct st_VioSSLAcceptorFd*, Vio*, long timeout);
+int sslaccept(struct st_VioSSLAcceptorFd*, Vio*, long timeout);
int sslconnect(struct st_VioSSLConnectorFd*, Vio*, long timeout);
struct st_VioSSLConnectorFd
@@ -245,7 +245,6 @@ struct st_vio
#ifdef HAVE_OPENSSL
SSL* ssl_;
- my_bool open_;
#endif /* HAVE_OPENSSL */
#ifdef HAVE_SMEM
HANDLE handle_file_map;