diff options
author | bell@51.0.168.192.in-addr.arpa <> | 2005-02-20 18:49:27 +0200 |
---|---|---|
committer | bell@51.0.168.192.in-addr.arpa <> | 2005-02-20 18:49:27 +0200 |
commit | a11369b999e3002586697c90743ae690a5623917 (patch) | |
tree | ef69852c850b3445152229f7707b70a1601e70c1 /include | |
parent | 6da6c5be0c57a2bad1aa4546ef8ea7094376cb5d (diff) | |
parent | 2c263ff24c0daf90c2f78e8a596a0fa3e3fc4b49 (diff) | |
download | mariadb-git-a11369b999e3002586697c90743ae690a5623917.tar.gz |
Merge
Diffstat (limited to 'include')
-rw-r--r-- | include/config-win.h | 26 | ||||
-rw-r--r-- | include/decimal.h | 13 | ||||
-rw-r--r-- | include/my_global.h | 2 | ||||
-rw-r--r-- | include/my_pthread.h | 8 | ||||
-rw-r--r-- | include/my_sys.h | 3 |
5 files changed, 34 insertions, 18 deletions
diff --git a/include/config-win.h b/include/config-win.h index cb2c072d056..475141a1989 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -31,18 +31,25 @@ functions */ #define HAVE_SMEM 1 -#if defined(__NT__) -#define SYSTEM_TYPE "NT" -#elif defined(__WIN2000__) -#define SYSTEM_TYPE "WIN2000" +#if defined(_WIN64) || defined(WIN64) +#define SYSTEM_TYPE "Win64" +#elif defined(_WIN32) || defined(WIN32) +#define SYSTEM_TYPE "Win32" #else -#define SYSTEM_TYPE "Win95/Win98" +#define SYSTEM_TYPE "Windows" #endif -#if defined(_WIN64) || defined(WIN64) -#define MACHINE_TYPE "ia64" /* Define to machine type name */ +#if defined(_M_IA64) +#define MACHINE_TYPE "ia64" +#elif defined(_M_IX86) +#define MACHINE_TYPE "ia32" +#elif defined(_M_ALPHA) +#define MACHINE_TYPE "axp" #else -#define MACHINE_TYPE "i32" /* Define to machine type name */ +#define MACHINE_TYPE "unknown" /* Define to machine type name */ +#endif + +#if !(defined(_WIN64) || defined(WIN64)) #ifndef _WIN32 #define _WIN32 /* Compatible with old source */ #endif @@ -346,6 +353,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)) @@ -359,6 +368,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_global.h b/include/my_global.h index f5cd8edeab9..30b98b9fbeb 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -761,7 +761,7 @@ typedef long int32; #endif typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */ #else -error "Neither int or long is of 4 bytes width" +#error "Neither int or long is of 4 bytes width" #endif #if !defined(HAVE_ULONG) && !defined(HAVE_LINUXTHREADS) && !defined(__USE_MISC) diff --git a/include/my_pthread.h b/include/my_pthread.h index 57240788e2f..b170753913b 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -637,7 +637,7 @@ extern int pthread_dummy(int); MySQL can survive with 32K, but some glibc libraries require > 128K stack To resolve hostnames */ -#define DEFAULT_THREAD_STACK (192*1024L) +#define DEFAULT_THREAD_STACK (256*1024L) #else #define DEFAULT_THREAD_STACK (192*1024) #endif @@ -689,12 +689,12 @@ extern pthread_t shutdown_th, main_th, signal_th; #define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L))) #define thread_safe_sub(V,C,L) \ (pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L))) -#if defined (__GNUC__) || defined (__cplusplus) -static inline bool thread_safe_dec_and_test(ulong V, pthread_mutex_t *L) +#ifdef __cplusplus +static inline bool thread_safe_dec_and_test(ulong &V, pthread_mutex_t *L) { ulong res; pthread_mutex_lock(L); - res=V--; + res=--V; pthread_mutex_unlock(L); return res==0; } diff --git a/include/my_sys.h b/include/my_sys.h index 72d4bec74b1..9cce13e53dd 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -811,7 +811,8 @@ 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 |