summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in6
-rw-r--r--libmysql/password.c2
-rw-r--r--mysys/hash.c15
-rw-r--r--mysys/my_static.c2
-rw-r--r--mysys/my_static.h2
-rw-r--r--mysys/my_tempnam.c6
-rw-r--r--sql/sql_analyse.cc2
7 files changed, 26 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index 3fb495281a0..3a5c1a56408 100644
--- a/configure.in
+++ b/configure.in
@@ -893,6 +893,12 @@ case $SYSTEM_TYPE in
echo "Using --with-named-thread=-lpthread"
with_named_thread="-lpthread"
fi
+ # Fixes for HPUX 11.0 compiler
+ if test "$ac_cv_prog_gcc" = "no"
+ then
+ CFLAGS="$CFLAGS +DD64 -DHAVE_BROKEN_INLINE"
+ CXXFLAGS="$CXXFLAGS +DD64 +O2"
+ fi
;;
*rhapsody*)
if test "$ac_cv_prog_gcc" = "yes"
diff --git a/libmysql/password.c b/libmysql/password.c
index 0fd5861873a..71ed68c6b2c 100644
--- a/libmysql/password.c
+++ b/libmysql/password.c
@@ -92,7 +92,7 @@ void make_scrambled_password(char *to,const char *password)
sprintf(to,"%08lx%08lx",hash_res[0],hash_res[1]);
}
-static inline uint char_val(char X)
+static inline unsigned int char_val(char X)
{
return (uint) (X >= '0' && X <= '9' ? X-'0' :
X >= 'A' && X <= 'Z' ? X-'A'+10 :
diff --git a/mysys/hash.c b/mysys/hash.c
index eb74b1f30dd..602823e6d43 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -83,7 +83,12 @@ void hash_free(HASH *hash)
/* some helper functions */
-inline byte*
+/*
+ This function is char* instead of byte* as HPUX11 compiler can't
+ handle inline functions that are not defined as native types
+*/
+
+inline char*
hash_key(HASH *hash,const byte *record,uint *length,my_bool first)
{
if (hash->get_key)
@@ -104,7 +109,7 @@ static uint hash_rec_mask(HASH *hash,HASH_LINK *pos,uint buffmax,
uint maxlength)
{
uint length;
- byte *key=hash_key(hash,pos->data,&length,0);
+ byte *key= (byte*) hash_key(hash,pos->data,&length,0);
return hash_mask((*hash->calc_hashnr)(key,length),buffmax,maxlength);
}
@@ -183,10 +188,10 @@ uint calc_hashnr_caseup(const byte *key, uint len)
#ifndef __SUNPRO_C /* SUNPRO can't handle this */
inline
#endif
-uint rec_hashnr(HASH *hash,const byte *record)
+unsigned int rec_hashnr(HASH *hash,const byte *record)
{
uint length;
- byte *key=hash_key(hash,record,&length,0);
+ byte *key= (byte*) hash_key(hash,record,&length,0);
return (*hash->calc_hashnr)(key,length);
}
@@ -273,7 +278,7 @@ static void movelink(HASH_LINK *array,uint find,uint next_link,uint newlink)
static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length)
{
uint rec_keylength;
- byte *rec_key=hash_key(hash,pos->data,&rec_keylength,1);
+ byte *rec_key= (byte*) hash_key(hash,pos->data,&rec_keylength,1);
return (length && length != rec_keylength) ||
(hash->flags & HASH_CASE_INSENSITIVE ?
my_casecmp(rec_key,key,rec_keylength) :
diff --git a/mysys/my_static.c b/mysys/my_static.c
index 00061893cdc..72bf7207efa 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -61,7 +61,7 @@ USED_MEM* my_once_root_block=0; /* pointer to first block */
uint my_once_extra=ONCE_ALLOC_INIT; /* Memory to alloc / block */
/* from my_tempnam */
-#ifndef HAVE_TEMPNAM
+#if !defined(HAVE_TEMPNAM) || defined(HPUX11)
int _my_tempnam_used=0;
#endif
diff --git a/mysys/my_static.h b/mysys/my_static.h
index e9d1a30b786..e139b0ec127 100644
--- a/mysys/my_static.h
+++ b/mysys/my_static.h
@@ -57,7 +57,7 @@ extern const char *soundex_map;
extern USED_MEM* my_once_root_block;
extern uint my_once_extra;
-#ifndef HAVE_TEMPNAM
+#if !defined(HAVE_TEMPNAM) || defined(HPUX11)
extern int _my_tempnam_used;
#endif
diff --git a/mysys/my_tempnam.c b/mysys/my_tempnam.c
index fdaf018af0d..d4979fcaa6e 100644
--- a/mysys/my_tempnam.c
+++ b/mysys/my_tempnam.c
@@ -24,6 +24,12 @@
#include "mysys_priv.h"
#include <m_string.h>
+
+/* HPUX 11.0 doesn't allow us to change the environ pointer */
+#ifdef HPUX11
+#undef HAVE_TEMPNAM
+#endif
+
#include "my_static.h"
#include "mysys_err.h"
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index de367e8c052..457356d4253 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -641,7 +641,7 @@ bool analyse::end_of_records()
case FIELD_TYPE_DECIMAL:
ans.append("DECIMAL", 7);
// if item is FIELD_ITEM, it _must_be_ Field_num in this case
- if (((Field_num*) (*f)->item)->zerofill)
+ if (((Field_num*) ((Item_field*) (*f)->item)->field)->zerofill)
ans.append(" ZEROFILL");
break;
default: