Skip to content

Commit

Permalink
add hash_value function + fix archive rule
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Nov 4, 2016
1 parent 3ed646a commit d6dee5b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
27 changes: 5 additions & 22 deletions makefiles/Makefile.archive.mk
Original file line number Diff line number Diff line change
Expand Up @@ -143,27 +143,7 @@ java_archive: java
$(COPY) examples$Sdata$Squasigroup_completion$S* temp$S$(INSTALL_DIR)$Sexamples$Sdata$Squasigroup_completion
$(COPY) examples$Scom$Sgoogle$Sortools$Ssamples$S*.java temp$S$(INSTALL_DIR)$Sexamples$Scom$Sgoogle$Sortools$Ssamples


ifeq "$(SYSTEM)" "win"
fz_archive: fz
-$(DELREC) temp
mkdir temp
mkdir temp$S$(FZ_INSTALL_DIR)
mkdir temp$S$(FZ_INSTALL_DIR)$Sbin
mkdir temp$S$(FZ_INSTALL_DIR)$Slib
mkdir temp$S$(FZ_INSTALL_DIR)$Sshare
mkdir temp$S$(FZ_INSTALL_DIR)$Sshare$Sminizinc
mkdir temp$S$(FZ_INSTALL_DIR)$Sexamples
$(COPY) LICENSE-2.0.txt temp$S$(FZ_INSTALL_DIR)
$(COPY) bin$Sfz$E temp$S$(FZ_INSTALL_DIR)$Sbin$Sfzn-or-tools$E
$(COPY) $(LIB_DIR)$S$(LIB_PREFIX)ortools.$(LIB_SUFFIX) temp$S$(FZ_INSTALL_DIR)$Slib
$(COPY) $(LIB_DIR)$S$(LIB_PREFIX)fz.$(LIB_SUFFIX) temp$S$(FZ_INSTALL_DIR)$Slib
$(COPY) src$Sflatzinc$Smznlib$S* temp$S$(FZ_INSTALL_DIR)$Sshare$Sminizinc
$(COPY) examples$Sflatzinc$S* temp$S$(FZ_INSTALL_DIR)$Sexamples
cd temp && ..$Stools$Szip.exe -r ..$S$(FZ_INSTALL_DIR).zip $(FZ_INSTALL_DIR)
-$(DELREC) temp
else
fz_archive: $(LIB_DIR)$S$(LIB_PREFIX)ortools.$(LIB_SUFFIX) $(LIB_DIR)$S$(LIB_PREFIX)fz.$(LIB_SUFFIX)
fz_archive: cc fz
-$(DELREC) temp
mkdir temp
mkdir temp$S$(FZ_INSTALL_DIR)
Expand All @@ -180,6 +160,9 @@ fz_archive: $(LIB_DIR)$S$(LIB_PREFIX)ortools.$(LIB_SUFFIX) $(LIB_DIR)$S$(LIB_PRE
$(COPY) src$Sflatzinc$Smznlib_cp$S* temp$S$(FZ_INSTALL_DIR)$Sshare$Sminizinc_cp
$(COPY) src$Sflatzinc$Smznlib_sat$S* temp$S$(FZ_INSTALL_DIR)$Sshare$Sminizinc_sat
$(COPY) examples$Sflatzinc$S* temp$S$(FZ_INSTALL_DIR)$Sexamples
ifeq "$(SYSTEM)" "win"
cd temp && ..$Stools$Szip.exe -r ..$S$(FZ_INSTALL_DIR).zip $(FZ_INSTALL_DIR)
else
ifeq ($(PLATFORM),LINUX)
$(DEP_BIN_DIR)$Spatchelf --set-rpath '$$ORIGIN/../lib' temp$S$(FZ_INSTALL_DIR)$Sbin$Sfzn-or-tools
endif
Expand All @@ -190,8 +173,8 @@ ifeq ($(PLATFORM),MACOSX)
$(RM) temp$S$(FZ_INSTALL_DIR)$Sfix_fz_libraries_on_mac.sh
endif
cd temp && tar cvzf ..$S$(FZ_INSTALL_DIR).tar.gz $(FZ_INSTALL_DIR)
-$(DELREC) temp
endif
-$(DELREC) temp


test_archive: $(INSTALL_DIR)$(ARCHIVE_EXT)
Expand Down
11 changes: 11 additions & 0 deletions src/base/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,17 @@ struct StdArrayHasher : public stdext::hash_compare<std::array<T, N>> {
static const size_t min_buckets = 8; // 4 and 8 are defaults.
};

#if defined(_MSC_VER)
namespace stdext {
template <>
inline size_t hash_value <std::pair<int64, int64>> (
const std::pair<int64, int64>& a) {
PairIntHasher pairIntHasher;
return pairIntHasher(a);
}
} // namespace stdext
#endif // _MSC_VER

using std::hash;
using stdext::hash_map;
using stdext::hash_set;
Expand Down

0 comments on commit d6dee5b

Please sign in to comment.