diff --git a/include/portability.h b/include/portability.h index 0c4c7c43ba8..b32864794e1 100644 --- a/include/portability.h +++ b/include/portability.h @@ -1,31 +1,25 @@ #ifndef TOKU_PORTABILITY_H #define TOKU_PORTABILITY_H +// Tokutek portability layer + #if defined __cplusplus extern "C" { #endif -// Portability layer -#define DEV_NULL_FILE "/dev/null" +#if defined(_MSC_VER) || (defined(__INTEL_COMPILER) && defined(__ICL)) -#if defined(_MSC_VER) -// Microsoft compiler #define TOKU_WINDOWS 1 -#endif - -#if defined(__INTEL_COMPILER) -// Intel compiler - -#if defined(__ICL) -#define TOKU_WINDOWS 1 -#endif - -#undef DEV_NULL_FILE #define DEV_NULL_FILE "NUL" +#else + +#define TOKU_WINDOWS 0 +#define DEV_NULL_FILE "/dev/null" + #endif -#if defined(TOKU_WINDOWS) +#if defined(TOKU_WINDOWS) && TOKU_WINDOWS // Windows // ntohl and htonl are defined in winsock.h diff --git a/newbrt/brttypes.h b/newbrt/brttypes.h index 0fd85298bd4..d753410a60d 100644 --- a/newbrt/brttypes.h +++ b/newbrt/brttypes.h @@ -10,9 +10,7 @@ #define _FILE_OFFSET_BITS 64 #include "../include/db.h" -#if !defined(TOKU_WINDOWS) #include -#endif typedef struct brt *BRT; struct brt_header; @@ -42,7 +40,7 @@ typedef struct __toku_lsn { u_int64_t lsn; } LSN; /* Make the FILEID a struct for the same reason. */ typedef struct __toku_fileid { u_int32_t fileid; } FILENUM; -#ifndef TOKU_WINDOWS +#if !TOKU_WINDOWS typedef enum __toku_bool { FALSE=0, TRUE=1} BOOL; #endif diff --git a/newbrt/includes.h b/newbrt/includes.h index a206c179dd2..83eb3f6004d 100644 --- a/newbrt/includes.h +++ b/newbrt/includes.h @@ -11,7 +11,7 @@ #include "portability.h" #include "os.h" -#if defined(TOKU_WINDOWS) +#if TOKU_WINDOWS #include "zlib.h" #include "toku_pthread.h" #include diff --git a/newbrt/log-internal.h b/newbrt/log-internal.h index f4265cc3e6c..b790fd7e3a1 100644 --- a/newbrt/log-internal.h +++ b/newbrt/log-internal.h @@ -9,9 +9,7 @@ #include "list.h" #include "memarena.h" #include -#if !defined(TOKU_WINDOWS) #include -#endif #include #include