From 48e85e891eeec7afea68da548200d091aa76067a Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Sat, 17 Jan 2015 17:48:54 +0300 Subject: [PATCH] lmdb: use pwritev() on non-windows systems (MDB_USE_PWRITEV). Change-Id: Iebd69846fc87cd6bb584002b366837ecb631b603 --- mdb.c | 58 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/mdb.c b/mdb.c index 25412654..2fcd1180 100644 --- a/mdb.c +++ b/mdb.c @@ -33,41 +33,43 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 +# define _GNU_SOURCE 1 #endif + #ifdef _WIN32 -#include -#include +# include +# include /** getpid() returns int; MinGW defines pid_t but MinGW64 typedefs it * as int64 which is wrong. MSVC doesn't define it at all, so just * don't use it. */ -#define MDB_PID_T int -#define MDB_THR_T DWORD -#include -#include -#ifdef __GNUC__ -# include +# define MDB_PID_T int +# define MDB_THR_T DWORD +# include +# include +# ifdef __GNUC__ +# include +# else +# define LITTLE_ENDIAN 1234 +# define BIG_ENDIAN 4321 +# define BYTE_ORDER LITTLE_ENDIAN +# ifndef SSIZE_MAX +# define SSIZE_MAX INT_MAX +# endif +# endif #else -# define LITTLE_ENDIAN 1234 -# define BIG_ENDIAN 4321 -# define BYTE_ORDER LITTLE_ENDIAN -# ifndef SSIZE_MAX -# define SSIZE_MAX INT_MAX -# endif -#endif -#else -#include -#include -#define MDB_PID_T pid_t -#define MDB_THR_T pthread_t -#include -#include -#include -#ifdef HAVE_SYS_FILE_H -#include -#endif -#include +# include +# include +# define MDB_PID_T pid_t +# define MDB_THR_T pthread_t +# include +# include +# include +# ifdef HAVE_SYS_FILE_H +# include +# endif +# include +# define MDB_USE_PWRITEV #endif /*****************************************************************************