blob: edcfd89aa17f4382636e52f312a9a3914bd01066 [file] [log] [blame]
Jon Skeete1e9d3e2022-03-28 11:31:18 +01001#region Copyright notice and license
2// Protocol Buffers - Google's data interchange format
3// Copyright 2008 Google Inc. All rights reserved.
Jon Skeete1e9d3e2022-03-28 11:31:18 +01004//
Joshua Haberman8c451772023-09-08 17:13:13 -07005// Use of this source code is governed by a BSD-style
6// license that can be found in the LICENSE file or at
7// https://developers.google.com/open-source/licenses/bsd
Jon Skeete1e9d3e2022-03-28 11:31:18 +01008#endregion
9
10using System;
11using System.Text.RegularExpressions;
12
13namespace Google.Protobuf
14{
15 /// <summary>
16 /// Class containing helpful workarounds for various platform compatibility
17 /// </summary>
18 internal static class FrameworkPortability
19 {
20 // The value of RegexOptions.Compiled is 8. We can test for the presence at
21 // execution time using Enum.IsDefined, so a single build will do the right thing
22 // on each platform. (RegexOptions.Compiled isn't supported by PCLs.)
23 internal static readonly RegexOptions CompiledRegexWhereAvailable =
24 Enum.IsDefined(typeof(RegexOptions), 8) ? (RegexOptions)8 : RegexOptions.None;
25 }
csharptest5cda54b2012-10-14 14:40:18 -050026}