summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorpetr@mysql.com <>2005-02-20 23:01:07 +0300
committerpetr@mysql.com <>2005-02-20 23:01:07 +0300
commit1e6bfa39c3f21881316fd6d2b22621fe9ccb59ee (patch)
tree4c24af9350f1687d3eafdee5b900ee80d74fb244 /include
parenta007751b03ca28b8c43e93829c3a500f6bdbafad (diff)
parentbacdd62fb9eee01f58f3e0b1ed685a5e165c5bac (diff)
downloadmariadb-git-1e6bfa39c3f21881316fd6d2b22621fe9ccb59ee.tar.gz
Merge mysql.com:/home/cps/mysql/trees/mysql-5.0
into mysql.com:/home/cps/mysql/devel/im-fix-review
Diffstat (limited to 'include')
-rw-r--r--include/config-win.h6
-rw-r--r--include/decimal.h13
-rw-r--r--include/my_sys.h6
3 files changed, 16 insertions, 9 deletions
diff --git a/include/config-win.h b/include/config-win.h
index 9918f69a978..ba1a987f14c 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -310,9 +310,6 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_SETFILEPOINTER
#define HAVE_VIO
-#define HAME_MMAP /* in mysys/my_mmap.c */
-#define HAVE_GETPAGESIZE /* in mysys/my_mmap.c */
-
#ifdef NOT_USED
#define HAVE_SNPRINTF /* Gave link error */
#define _snprintf snprintf
@@ -353,6 +350,8 @@ inline double ulonglong2double(ulonglong value)
#define DO_NOT_REMOVE_THREAD_WRAPPERS
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
+#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
+#define thread_safe_dec_and_test(V, L) thread_safe_decrement(V,L)
/* The following is only used for statistics, so it should be good enough */
#ifdef __NT__ /* This should also work on Win98 but .. */
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
@@ -366,6 +365,7 @@ inline double ulonglong2double(ulonglong value)
#define statistic_add(V,C,L) (V)+=(C)
#endif
#define statistic_increment(V,L) thread_safe_increment((V),(L))
+#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
#define shared_memory_buffer_length 16000
#define default_shared_memory_base_name "MYSQL"
diff --git a/include/decimal.h b/include/decimal.h
index 1e0ee97c267..3f4a2122c57 100644
--- a/include/decimal.h
+++ b/include/decimal.h
@@ -17,7 +17,9 @@
#ifndef _decimal_h
#define _decimal_h
-typedef enum {TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR} decimal_round_mode;
+typedef enum
+{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR}
+ decimal_round_mode;
typedef int32 decimal_digit;
typedef struct st_decimal {
@@ -26,11 +28,10 @@ typedef struct st_decimal {
decimal_digit *buf;
} decimal;
+int internal_str2dec(const char *from, decimal *to, char **end, my_bool fixed);
int decimal2string(decimal *from, char *to, int *to_len,
int fixed_precision, int fixed_decimals,
char filler);
-int string2decimal(char *from, decimal *to, char **end);
-int string2decimal_fixed(char *from, decimal *to, char **end);
int decimal2ulonglong(decimal *from, ulonglong *to);
int ulonglong2decimal(ulonglong from, decimal *to);
int decimal2longlong(decimal *from, longlong *to);
@@ -51,10 +52,14 @@ int decimal_cmp(decimal *from1, decimal *from2);
int decimal_mul(decimal *from1, decimal *from2, decimal *to);
int decimal_div(decimal *from1, decimal *from2, decimal *to, int scale_incr);
int decimal_mod(decimal *from1, decimal *from2, decimal *to);
-int decimal_round(decimal *from, decimal *to, int new_scale, decimal_round_mode mode);
+int decimal_round(decimal *from, decimal *to, int new_scale,
+ decimal_round_mode mode);
int decimal_is_zero(decimal *from);
void max_decimal(int precision, int frac, decimal *to);
+#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0)
+#define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1)
+
/* set a decimal to zero */
#define decimal_make_zero(dec) do { \
diff --git a/include/my_sys.h b/include/my_sys.h
index 7d3b402bc6f..cdef2070da6 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -796,7 +796,7 @@ void my_free_open_file_info(void);
ulonglong my_getsystime(void);
my_bool my_gethwaddr(uchar *to);
-#ifdef HAVE_MMAP
+#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#ifndef MAP_NOSYNC
@@ -811,9 +811,11 @@ my_bool my_gethwaddr(uchar *to);
/* not a complete set of mmap() flags, but only those that nesessary */
#define PROT_READ 1
#define PROT_WRITE 2
-#define MAP_NOSYNC 0x800
+#define MAP_SHARED 0x0001
+#define MAP_NOSYNC 0x0800
#define MAP_FAILED ((void *)-1)
#define MS_SYNC 0x0000
+#define HAVE_MMAP
int my_getpagesize(void);
void *my_mmap(void *, size_t, int, int, int, my_off_t);