summaryrefslogtreecommitdiff
path: root/mysys/ptr_cmp.c
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2010-12-21 13:00:26 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2010-12-21 13:00:26 +0100
commitf482437cdc22b01bd5f38e8eb6cdac9317baee28 (patch)
treec89697cfd2105436f135c4a0d9477da852d82981 /mysys/ptr_cmp.c
parent1e5b763660f51e4ad35749539cd579b92de3c43e (diff)
downloadmariadb-git-f482437cdc22b01bd5f38e8eb6cdac9317baee28.tar.gz
Bug #58699 cannot build with gcc dbg on solaris
Diffstat (limited to 'mysys/ptr_cmp.c')
-rw-r--r--mysys/ptr_cmp.c19
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) {