mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
portability fixes
This commit is contained in:
parent
77f9069c21
commit
d7958e9bb0
3 changed files with 14 additions and 9 deletions
|
@ -40,7 +40,6 @@ SHLIBEXT := sl
|
|||
endif
|
||||
|
||||
ifeq ($(NDB_OS), MACOSX)
|
||||
CCFLAGS_TOP += -DNDBOUT_UINTPTR
|
||||
SHLIBEXT := dylib
|
||||
endif
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue