summaryrefslogtreecommitdiff
path: root/utils/perfect_hash.h
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2012-05-17 10:46:23 -0400
committerVictor Chahuneau <vchahune@cs.cmu.edu>2012-05-17 10:46:23 -0400
commit3d44c4e9c80472c4e3f39bfbf730c192328c839c (patch)
treeb5ab7097634b3d5d1071bd53844fe368ec1dd8dc /utils/perfect_hash.h
parent141f566baf82129fd339fa28e1e98a17c6e37dcc (diff)
parent75d0f86f8f949e37c600096accf85d5521940f40 (diff)
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'utils/perfect_hash.h')
-rw-r--r--utils/perfect_hash.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/utils/perfect_hash.h b/utils/perfect_hash.h
index 8ac11f18..29ea48a9 100644
--- a/utils/perfect_hash.h
+++ b/utils/perfect_hash.h
@@ -1,15 +1,16 @@
#ifndef _PERFECT_HASH_MAP_H_
#define _PERFECT_HASH_MAP_H_
-#include "config.h"
+#include <vector>
+#include <boost/utility.hpp>
-#ifndef HAVE_CMPH
-#error libcmph is required to use PerfectHashFunction
+#ifdef HAVE_CONFIG_H
+#include "config.h"
#endif
-#include <vector>
-#include <boost/utility.hpp>
+#ifdef HAVE_CMPH
#include "cmph.h"
+#endif
class PerfectHashFunction : boost::noncopyable {
public:
@@ -18,7 +19,9 @@ class PerfectHashFunction : boost::noncopyable {
size_t operator()(const std::string& key) const;
size_t number_of_keys() const;
private:
+#ifdef HAVE_CMPH
cmph_t *mphf_;
+#endif
};
#endif