portability fixes

This commit is contained in:
tomas@mc05.(none) 2004-05-13 13:42:36 +02:00
parent 77f9069c21
commit d7958e9bb0
3 changed files with 14 additions and 9 deletions

View file

@ -40,7 +40,6 @@ SHLIBEXT := sl
endif
ifeq ($(NDB_OS), MACOSX)
CCFLAGS_TOP += -DNDBOUT_UINTPTR
SHLIBEXT := dylib
endif

View file

@ -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 <my_config.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
typedef uintptr_t UintPtr;
#endif

View file

@ -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
}