Jon Skeet | e1e9d3e | 2022-03-28 11:31:18 +0100 | [diff] [blame] | 1 | #region Copyright notice and license |
| 2 | // Protocol Buffers - Google's data interchange format |
| 3 | // Copyright 2008 Google Inc. All rights reserved. |
Jon Skeet | e1e9d3e | 2022-03-28 11:31:18 +0100 | [diff] [blame] | 4 | // |
Joshua Haberman | 8c45177 | 2023-09-08 17:13:13 -0700 | [diff] [blame] | 5 | // 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 Skeet | e1e9d3e | 2022-03-28 11:31:18 +0100 | [diff] [blame] | 8 | #endregion |
| 9 | |
| 10 | using System; |
| 11 | using System.Text.RegularExpressions; |
| 12 | |
| 13 | namespace 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 | } |
csharptest | 5cda54b | 2012-10-14 14:40:18 -0500 | [diff] [blame] | 26 | } |