Skip to content

Commit 7af287e

Browse files
authored
Merge pull request clojure#25 from arcadia-unity/spec-env-vars-on-mono
Expose environment vars that control spec to Mono platforms
2 parents 03ff59d + fe60366 commit 7af287e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Clojure/Clojure/Lib/RT.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,22 @@ static Assembly ResolveAssembly(object sender, ResolveEventArgs args)
553553
return Assembly.Load(ReadStreamBytes(stream));
554554
}
555555

556+
#if MONO
557+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2211:NonConstantFieldsShouldNotBeVisible")]
558+
public static bool checkSpecAsserts = ReadTrueFalseDefault(Environment.GetEnvironmentVariable("CLOJURE_SPEC_CHECK_ASSERTS"), false);
559+
#else
556560
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2211:NonConstantFieldsShouldNotBeVisible")]
557561
public static bool checkSpecAsserts = ReadTrueFalseDefault(Environment.GetEnvironmentVariable("clojure.spec.check-asserts"), false);
562+
#endif
558563

564+
#if MONO
565+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2211:NonConstantFieldsShouldNotBeVisible")]
566+
public static bool instrumentMacros = !ReadTrueFalseDefault(Environment.GetEnvironmentVariable("CLOJURE_SPEC_SKIP_MACROS"), false);
567+
#else
559568
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2211:NonConstantFieldsShouldNotBeVisible")]
560569
public static bool instrumentMacros = !ReadTrueFalseDefault(Environment.GetEnvironmentVariable("clojure.spec.skip-macros"), false);
561-
570+
#endif
571+
562572
internal static volatile bool CHECK_SPECS = false;
563573

564574
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]

0 commit comments

Comments
 (0)