From d1b819982e2f5f6fcd4cdaf591973eecbfc2abe1 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 24 Jun 2016 01:16:17 -0500 Subject: [PATCH] Fix issues building with MSVC --- CMakeLists.txt | 10 +++++----- src/_types.hpp | 4 ++-- src/filestore.hpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bada3ad46..82d0ed626 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,11 +6,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) include(address_sanitizer) add_definitions( - -std=c++11 - -Wall - -nostdlib - -fno-exceptions - -fno-rtti #-Werror #--analyze #-Os # GCC size optimization flag @@ -18,6 +13,11 @@ add_definitions( if(NOT MSVC) add_definitions( + -std=c++11 + -Wall + -nostdlib + -fno-exceptions + -fno-rtti -Wsign-compare ) endif(NOT MSVC) diff --git a/src/_types.hpp b/src/_types.hpp index 58f0b2742..c5fe2a944 100644 --- a/src/_types.hpp +++ b/src/_types.hpp @@ -25,9 +25,9 @@ typedef unsigned long long uint64_t; typedef uint32_t Error; -#if defined(_LP64) || defined(__ppc64__) +#if defined(_LP64) || defined(__ppc64__) || defined(_WIN64) typedef uint64_t size_t; -#elif defined(_LP32) || defined(__ppc__) +#elif defined(_LP32) || defined(__ppc__) || defined(_WIN32) typedef uint32_t size_t; #else #error size_t undefined diff --git a/src/filestore.hpp b/src/filestore.hpp index 7d690db8b..bf4798540 100644 --- a/src/filestore.hpp +++ b/src/filestore.hpp @@ -122,7 +122,7 @@ class FileStore { * @param pathLen number of characters in pathLen * @return the requested Inode, if available */ - Inode *getRecord(FileStore::Inode *root, InodeId_t id); + Inode *getRecord(Inode *root, InodeId_t id); /** * Gets an address for a new Inode. @@ -263,7 +263,7 @@ typename FileStore::FsHeader *FileStore::getHeader() { } template -typename FileStore::Inode *FileStore::getRecord(FileStore::Inode *root, InodeId_t id) { +typename FileStore::Inode *FileStore::getRecord(Inode *root, InodeId_t id) { Inode *retval = nullptr; if (root->m_id > id) {