From 09761a8967c5119f9f55e1f7e917f55369eded8b Mon Sep 17 00:00:00 2001 From: csharptest Date: Sun, 14 Oct 2012 23:13:09 -0500 Subject: [PATCH] Build fixes from portable changes --- src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs | 8 ++++---- src/ProtocolBuffers/TextFormat.cs | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs b/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs index 3c9504c43b..798f0dd753 100644 --- a/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs +++ b/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs @@ -136,7 +136,7 @@ namespace Google.ProtocolBuffers.FieldAccess internal static Func CreateDelegateFunc(MethodInfo method) { -#if !NOCREATEDELEGATE +#if !CF20 object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); return (Func)tdelegate; #else @@ -146,7 +146,7 @@ namespace Google.ProtocolBuffers.FieldAccess internal static Func CreateDelegateFunc(MethodInfo method) { -#if !NOCREATEDELEGATE +#if !CF20 object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); return (Func)tdelegate; #else @@ -160,7 +160,7 @@ namespace Google.ProtocolBuffers.FieldAccess internal static Func CreateDelegateFunc(MethodInfo method) { -#if !NOCREATEDELEGATE +#if !CF20 object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); return (Func)tdelegate; #else @@ -174,7 +174,7 @@ namespace Google.ProtocolBuffers.FieldAccess internal static Action CreateDelegateAction(MethodInfo method) { -#if !NOCREATEDELEGATE +#if !CF20 object tdelegate = Delegate.CreateDelegate(typeof(Action), null, method); return (Action)tdelegate; #else diff --git a/src/ProtocolBuffers/TextFormat.cs b/src/ProtocolBuffers/TextFormat.cs index 7e2eff0426..7ea25053b2 100644 --- a/src/ProtocolBuffers/TextFormat.cs +++ b/src/ProtocolBuffers/TextFormat.cs @@ -708,7 +708,11 @@ namespace Google.ProtocolBuffers { // Explicitly specify the invariant culture so that this code does not break when // executing in Turkey. +#if PORTABLE_LIBRARY String lowerName = name.ToLowerInvariant(); +#else + String lowerName = name.ToLower(FrameworkPortability.InvariantCulture); +#endif field = type.FindDescriptor(lowerName); // If the case-insensitive match worked but the field is NOT a group, // TODO(jonskeet): What? Java comment ends here!