diff options
author | Tor Didriksen <tor.didriksen@oracle.com> | 2010-12-21 13:00:26 +0100 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@oracle.com> | 2010-12-21 13:00:26 +0100 |
commit | 029a5df87044dd392d3c393a2ba1c882722c94e0 (patch) | |
tree | c89697cfd2105436f135c4a0d9477da852d82981 /mysys/ptr_cmp.c | |
parent | 3dcdd6957ad90055e16a3a861520301e421d307b (diff) | |
download | mariadb-git-029a5df87044dd392d3c393a2ba1c882722c94e0.tar.gz |
Bug #58699 cannot build with gcc dbg on solaris
cmake/os/SunOS.cmake:
Remove TARGET_OS_SOLARIS
config.h.cmake:
Remove TARGET_OS_SOLARIS
Add PTHREAD_ONCE_INITIALIZER
configure.cmake:
Add function for testing whether we need { PTHREAD_ONCE_INIT } rather than PTHREAD_ONCE_INIT
include/my_pthread.h:
Use PTHREAD_ONCE_INITIALIZER if set by cmake.
include/mysql/psi/mysql_file.h:
Include my_global.h first, to get correct platform definitions.
mysys/ptr_cmp.c:
Hide the unused static functions in #ifdef's on solaris.
Use __sun (defined by both gcc and SunPro cc) rather than TARGET_OS_SOLARIS
sql/my_decimal.cc:
Include my_global.h first, to get correct platform definitions.
sql/mysqld.cc:
Fix signed/unsigned comparison warning.
sql/sql_audit.h:
Include my_global.h first, to get correct platform definitions.
sql/sql_plugin.h:
Include my_global.h first, to get correct platform definitions.
sql/sql_show.cc:
Fix: warning: cast from pointer to integer of different size
sql/sys_vars.h:
Use reinterpret_cast rather than c-style cast.
storage/perfschema/pfs_instr.cc:
Include my_global.h first, to get correct platform definitions.
Diffstat (limited to 'mysys/ptr_cmp.c')
-rw-r--r-- | mysys/ptr_cmp.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/mysys/ptr_cmp.c b/mysys/ptr_cmp.c index 2005e3eb2b7..dcafe13291d 100644 --- a/mysys/ptr_cmp.c +++ b/mysys/ptr_cmp.c @@ -22,7 +22,7 @@ #include "mysys_priv.h" #include <myisampack.h> -#ifdef TARGET_OS_SOLARIS +#ifdef __sun /* * On Solaris, memcmp() is normally faster than the unrolled ptr_compare_N * functions, as memcmp() is usually a platform-specific implementation @@ -39,22 +39,25 @@ static int native_compare(size_t *length, unsigned char **a, unsigned char **b) return memcmp(*a, *b, *length); } -#else /* TARGET_OS_SOLARIS */ +#else /* __sun */ static int ptr_compare(size_t *compare_length, uchar **a, uchar **b); static int ptr_compare_0(size_t *compare_length, uchar **a, uchar **b); static int ptr_compare_1(size_t *compare_length, uchar **a, uchar **b); static int ptr_compare_2(size_t *compare_length, uchar **a, uchar **b); static int ptr_compare_3(size_t *compare_length, uchar **a, uchar **b); -#endif /* TARGET_OS_SOLARIS */ +#endif /* __sun */ /* Get a pointer to a optimal byte-compare function for a given size */ -qsort2_cmp get_ptr_compare (size_t size) +#ifdef __sun +qsort2_cmp get_ptr_compare (size_t size __attribute__((unused))) { -#ifdef TARGET_OS_SOLARIS return (qsort2_cmp) native_compare; +} #else +qsort2_cmp get_ptr_compare (size_t size) +{ if (size < 4) return (qsort2_cmp) ptr_compare; switch (size & 3) { @@ -64,8 +67,8 @@ qsort2_cmp get_ptr_compare (size_t size) case 3: return (qsort2_cmp) ptr_compare_3; } return 0; /* Impossible */ -#endif /* TARGET_OS_SOLARIS */ } +#endif /* __sun */ /* @@ -75,6 +78,8 @@ qsort2_cmp get_ptr_compare (size_t size) #define cmp(N) if (first[N] != last[N]) return (int) first[N] - (int) last[N] +#ifndef __sun + static int ptr_compare(size_t *compare_length, uchar **a, uchar **b) { reg3 int length= *compare_length; @@ -177,6 +182,8 @@ static int ptr_compare_3(size_t *compare_length,uchar **a, uchar **b) return (0); } +#endif /* !__sun */ + void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos) { switch (pack_length) { |