From 1a9d07831ca7a9dc8597b1bd03fff31ae986fa8d Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 5 Dec 2019 17:35:40 -0500 Subject: [PATCH] add conanfile.py, and fix a couple windows warnings. --- parallel_hashmap/conanfile.py | 36 +++++++++++++++++++++++++++++++++++ parallel_hashmap/phmap.h | 4 ++-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 parallel_hashmap/conanfile.py diff --git a/parallel_hashmap/conanfile.py b/parallel_hashmap/conanfile.py new file mode 100644 index 0000000..c046377 --- /dev/null +++ b/parallel_hashmap/conanfile.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from conans import ConanFile, tools +import os + +class SparseppConan(ConanFile): + name = "parallel_hashmap" + version = "1.27" + description = "A header-only, very fast and memory-friendly hash map" + + # Indicates License type of the packaged library + license = "https://github.com/greg7mdp/parallel-hashmap/blob/master/LICENSE" + + # Packages the license for the conanfile.py + exports = ["LICENSE"] + + # Custom attributes for Bincrafters recipe conventions + source_subfolder = "source_subfolder" + + def source(self): + source_url = "https://github.com/greg7mdp/parallel-hashmap" + tools.get("{0}/archive/{1}.tar.gz".format(source_url, self.version)) + extracted_dir = self.name + "-" + self.version + + #Rename to "source_folder" is a convention to simplify later steps + os.rename(extracted_dir, self.source_subfolder) + + + def package(self): + include_folder = os.path.join(self.source_subfolder, "parallel_hashmap") + self.copy(pattern="LICENSE") + self.copy(pattern="*", dst="include/parallel_hashmap", src=include_folder) + + def package_id(self): + self.info.header_only() diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index fce786d..b388e23 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -3561,8 +3561,8 @@ namespace memory_internal { // ---------------------------------------------------------------------------- template struct OffsetOf { - static constexpr size_t kFirst = -1; - static constexpr size_t kSecond = -1; + static constexpr size_t kFirst = (size_t)-1; + static constexpr size_t kSecond = (size_t)-1; }; template