From d7958e9bb0eedfd13ad3faee3787e90520e34fb6 Mon Sep 17 00:00:00 2001 From: "tomas@mc05.(none)" <> Date: Thu, 13 May 2004 13:42:36 +0200 Subject: [PATCH] portability fixes --- ndb/Defs.mk | 1 - ndb/include/ndb_types.h | 10 ++++++++-- ndb/src/common/portlib/unix/NdbMem.c | 12 ++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ndb/Defs.mk b/ndb/Defs.mk index cf891caa5c2..ac4507562fd 100644 --- a/ndb/Defs.mk +++ b/ndb/Defs.mk @@ -40,7 +40,6 @@ SHLIBEXT := sl endif ifeq ($(NDB_OS), MACOSX) -CCFLAGS_TOP += -DNDBOUT_UINTPTR SHLIBEXT := dylib endif diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index 166368b99c5..5e7b952cfc5 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -18,8 +18,8 @@ * @file ndb_types.h */ -#ifndef SYS_TYPES_H -#define SYS_TYPES_H +#ifndef NDB_TYPES_H +#define NDB_TYPES_H typedef char Int8; typedef unsigned char Uint8; @@ -33,7 +33,13 @@ typedef unsigned int UintR; #ifdef __SIZE_TYPE__ typedef __SIZE_TYPE__ UintPtr; #else +#include +#ifdef HAVE_STDINT_H #include +#endif +#ifdef HAVE_INTTYPES_H +#include +#endif typedef uintptr_t UintPtr; #endif diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/unix/NdbMem.c index ce422f45a9d..0b06e5b23f1 100644 --- a/ndb/src/common/portlib/unix/NdbMem.c +++ b/ndb/src/common/portlib/unix/NdbMem.c @@ -54,18 +54,18 @@ void NdbMem_Free(void* ptr) int NdbMem_MemLockAll(){ -#ifndef HAVE_MLOCKALL - return -1; -#else +#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) return mlockall(MCL_CURRENT); +#else + return -1; #endif } int NdbMem_MemUnlockAll(){ -#ifndef HAVE_MLOCKALL - return -1; -#else +#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) return munlockall(); +#else + return -1; #endif }