From d939e4567d755a5a317f79638b5ef062bd6ce459 Mon Sep 17 00:00:00 2001 From: William Michaels <88730019+PolBreachIty@users.noreply.github.com> Date: Thu, 23 Sep 2021 11:33:48 -0500 Subject: [PATCH] fix: Use of CachedEnforcer throws error from clang (#153) - add to casbin_types.h for visibility of std::hash of CachedEnforcer's unordered_map - add default virtual destructor clang /include/c++/4.2.1 Apple clang version 12.0.5 (clang-1205.0.22.11) Target: x86_64-apple-darwin20.2.0 Signed-off-by: William Michaels --- casbin/enforcer_cached.h | 2 ++ include/casbin/casbin_types.h | 1 + 2 files changed, 3 insertions(+) diff --git a/casbin/enforcer_cached.h b/casbin/enforcer_cached.h index cd83287d..536e3849 100644 --- a/casbin/enforcer_cached.h +++ b/casbin/enforcer_cached.h @@ -84,6 +84,8 @@ class CachedEnforcer : public Enforcer { */ CachedEnforcer(const std::string& model_path, const std::string& policy_file, bool enable_log); + virtual ~CachedEnforcer() = default; + bool Enforce(Scope scope); // Enforce with a vector param,decides whether a "subject" can access a diff --git a/include/casbin/casbin_types.h b/include/casbin/casbin_types.h index c8159c1e..8f99d6c0 100644 --- a/include/casbin/casbin_types.h +++ b/include/casbin/casbin_types.h @@ -19,6 +19,7 @@ #ifndef CASBIN_CPP_CASBIN_TYPES_H #define CASBIN_CPP_CASBIN_TYPES_H +#include #include #include #include