summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-11-09 13:26:46 +0200
committerunknown <monty@hundin.mysql.fi>2002-11-09 13:26:46 +0200
commit212fe9d13ed51de7e858dedd2af71b115270af14 (patch)
treedc4bb2a2343e6494e99b3429fc1247fa2dd18281 /mysys
parentb3a8b8bd193dc9b22b8d5bc28c894c49f6153647 (diff)
downloadmariadb-git-212fe9d13ed51de7e858dedd2af71b115270af14.tar.gz
Portability fixes for HP compiler and HPUX11
Docs/internals.texi: Added protocol information (needs to be converted to texi and merged with the old documentation) configure.in: Updates for HP compiler (cc) include/my_global.h: Add option to handle bugs in 'inline' for HP compiler libmysql/password.c: Portability fix (for HP compiler) mysys/hash.c: Portability fix (for HP compiler) mysys/my_static.c: Portability fix (for HPUX11) mysys/my_static.h: Portability fix (for HPUX11) mysys/my_tempnam.c: Portability fix (for HPUX11) sql/sql_analyse.cc: Fixed bug in decimal handling
Diffstat (limited to 'mysys')
-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
4 files changed, 18 insertions, 7 deletions
diff --git a/mysys/hash.c b/mysys/hash.c
index eaea6d7503f..3afd31a079b 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -82,7 +82,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)
@@ -103,7 +108,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);
}
@@ -180,10 +185,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);
}
@@ -270,7 +275,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 1eb6220f185..bbf7582a454 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -60,7 +60,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 10b2e0fc2d2..c1893f4074f 100644
--- a/mysys/my_static.h
+++ b/mysys/my_static.h
@@ -65,7 +65,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 6c17aa5b165..4fa2dd2abc4 100644
--- a/mysys/my_tempnam.c
+++ b/mysys/my_tempnam.c
@@ -23,6 +23,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"