Skip to content

Commit 5a2807b

Browse files
committed
fix: replaced pragma with include guard
Signed-off-by: Yash Pandey (YP) <[email protected]>
1 parent 8c76f28 commit 5a2807b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+461
-195
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
mono_crash.*
1818

1919
# Build results
20+
build
2021
[Dd]ebug/
2122
[Dd]ebugPublic/
2223
[Rr]elease/

casbin/config/config.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
#pragma once
18-
1917
#include "pch.h"
2018

19+
#ifndef CONFIG_CPP
20+
#define CONFIG_CPP
21+
22+
2123
#include <fstream>
2224
#include <sstream>
2325
#include <algorithm>
@@ -180,4 +182,6 @@ string Config :: Get(string key) {
180182
if (ok)
181183
return data[section][option];
182184
return "";
183-
}
185+
}
186+
187+
#endif // CONFIG_CPP

casbin/duktape/duktape.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,13 @@
151151
* If you are accidentally missing from this list, send me an e-mail
152152
* (``[email protected]``) and I'll fix the omission.
153153
*/
154-
#pragma once
155154

156155
#include "pch.h"
157156

157+
#ifndef DUKTAPE_CPP
158+
#define DUKTAPE_CPP
159+
160+
158161
// #include "duk_config.h"
159162

160163
#line 1 "duk_replacements.c"
@@ -99759,3 +99762,5 @@ DUK_INTERNAL duk_double_t duk_util_tinyrandom_get_double(duk_hthread *thr) {
9975999762
#undef DUK__RANDOM_XOROSHIRO128PLUS
9976099763
#undef DUK__RND_BIT
9976199764
#undef DUK__UPDATE_RND
99765+
99766+
#endif // DUKTAPE_CPP

casbin/effect/default_effector.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
#pragma once
18-
1917
#include "pch.h"
2018

19+
#ifndef DEFAULT_EFFECTOR_CPP
20+
#define DEFAULT_EFFECTOR_CPP
21+
22+
2123
#include "./default_effector.h"
2224
#include "../exception/unsupported_operation_exception.h"
2325

@@ -70,4 +72,6 @@ bool DefaultEffector :: MergeEffects(string expr, vector<Effect> effects, vector
7072
}
7173

7274
return result;
73-
}
75+
}
76+
77+
#endif // DEFAULT_EFFECTOR_CPP

casbin/enforcer.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
#pragma once
18-
1917
#include "pch.h"
2018

19+
#ifndef ENFORCER_CPP
20+
#define ENFORCER_CPP
21+
22+
2123
#include <algorithm>
2224

2325
#include "./enforcer.h"
@@ -484,4 +486,6 @@ bool Enforcer::EnforceWithMatcher(string matcher, unordered_map<string, string>
484486
bool result = this->enforce(matcher, scope);
485487
DeinitializeScope(scope);
486488
return result;
487-
}
489+
}
490+
491+
#endif // ENFORCER_CPP

casbin/enforcer_cached.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
#pragma once
18-
1917
#include "pch.h"
2018

19+
#ifndef ENFORCER_CACHED_CPP
20+
#define ENFORCER_CACHED_CPP
21+
22+
2123
#include "./enforcer_cached.h"
2224
#include "./persist/watcher_ex.h"
2325
#include "./persist/file_adapter/file_adapter.h"
@@ -210,4 +212,6 @@ bool CachedEnforcer::EnforceWithMatcher(string matcher, unordered_map<string, st
210212
bool res = Enforcer::EnforceWithMatcher(matcher,params);
211213
setCachedResult(key, res);
212214
return res;
213-
}
215+
}
216+
217+
#endif // ENFORCER_CACHED_CPP
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
#pragma once
2-
31
#include "pch.h"
42

3+
#ifndef CASBIN_ADAPTER_EXCEPTION_CPP
4+
#define CASBIN_ADAPTER_EXCEPTION_CPP
5+
6+
57
#include "./casbin_adapter_exception.h"
68

79
CasbinAdapterException :: CasbinAdapterException(string error_message) {
810
this->error_message = error_message;
9-
}
11+
}
12+
13+
#endif // CASBIN_ADAPTER_EXCEPTION_CPP
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
#pragma once
2-
31
#include "pch.h"
42

3+
#ifndef CASBIN_ENFORCER_EXCEPTION_CPP
4+
#define CASBIN_ENFORCER_EXCEPTION_CPP
5+
6+
57
#include "./casbin_enforcer_exception.h"
68

79
CasbinEnforcerException :: CasbinEnforcerException(string error_message){
810
this->error_message = error_message;
9-
}
11+
}
12+
13+
#endif // CASBIN_ENFORCER_EXCEPTION_CPP
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
#pragma once
2-
31
#include "pch.h"
42

3+
#ifndef CASBIN_RBAC_EXCEPTION_CPP
4+
#define CASBIN_RBAC_EXCEPTION_CPP
5+
6+
57
#include "./casbin_rbac_exception.h"
68

79
CasbinRBACException :: CasbinRBACException(string error_message){
810
this->error_message = error_message;
9-
}
11+
}
12+
13+
#endif // CASBIN_RBAC_EXCEPTION_CPP
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
#pragma once
2-
31
#include "pch.h"
42

3+
#ifndef ILLEGAL_ARGUMENT_EXCEPTION_CPP
4+
#define ILLEGAL_ARGUMENT_EXCEPTION_CPP
5+
6+
57
#include "./illegal_argument_exception.h"
68

79
IllegalArgumentException :: IllegalArgumentException(string error_message) {
810
this->error_message = error_message;
9-
}
11+
}
12+
13+
#endif // ILLEGAL_ARGUMENT_EXCEPTION_CPP

0 commit comments

Comments
 (0)