• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #region Copyright notice and license
2 // Protocol Buffers - Google's data interchange format
3 // Copyright 2008 Google Inc.  All rights reserved.
4 //
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
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     }
26 }