Build fixes from portable changes

pull/288/head
csharptest 12 years ago committed by rogerk
parent c9bce45a01
commit 09761a8967
  1. 8
      src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs
  2. 4
      src/ProtocolBuffers/TextFormat.cs

@ -136,7 +136,7 @@ namespace Google.ProtocolBuffers.FieldAccess
internal static Func<TResult> CreateDelegateFunc<TResult>(MethodInfo method) internal static Func<TResult> CreateDelegateFunc<TResult>(MethodInfo method)
{ {
#if !NOCREATEDELEGATE #if !CF20
object tdelegate = Delegate.CreateDelegate(typeof(Func<TResult>), null, method); object tdelegate = Delegate.CreateDelegate(typeof(Func<TResult>), null, method);
return (Func<TResult>)tdelegate; return (Func<TResult>)tdelegate;
#else #else
@ -146,7 +146,7 @@ namespace Google.ProtocolBuffers.FieldAccess
internal static Func<T, TResult> CreateDelegateFunc<T, TResult>(MethodInfo method) internal static Func<T, TResult> CreateDelegateFunc<T, TResult>(MethodInfo method)
{ {
#if !NOCREATEDELEGATE #if !CF20
object tdelegate = Delegate.CreateDelegate(typeof(Func<T, TResult>), null, method); object tdelegate = Delegate.CreateDelegate(typeof(Func<T, TResult>), null, method);
return (Func<T, TResult>)tdelegate; return (Func<T, TResult>)tdelegate;
#else #else
@ -160,7 +160,7 @@ namespace Google.ProtocolBuffers.FieldAccess
internal static Func<T1, T2, TResult> CreateDelegateFunc<T1, T2, TResult>(MethodInfo method) internal static Func<T1, T2, TResult> CreateDelegateFunc<T1, T2, TResult>(MethodInfo method)
{ {
#if !NOCREATEDELEGATE #if !CF20
object tdelegate = Delegate.CreateDelegate(typeof(Func<T1, T2, TResult>), null, method); object tdelegate = Delegate.CreateDelegate(typeof(Func<T1, T2, TResult>), null, method);
return (Func<T1, T2, TResult>)tdelegate; return (Func<T1, T2, TResult>)tdelegate;
#else #else
@ -174,7 +174,7 @@ namespace Google.ProtocolBuffers.FieldAccess
internal static Action<T1, T2> CreateDelegateAction<T1, T2>(MethodInfo method) internal static Action<T1, T2> CreateDelegateAction<T1, T2>(MethodInfo method)
{ {
#if !NOCREATEDELEGATE #if !CF20
object tdelegate = Delegate.CreateDelegate(typeof(Action<T1, T2>), null, method); object tdelegate = Delegate.CreateDelegate(typeof(Action<T1, T2>), null, method);
return (Action<T1, T2>)tdelegate; return (Action<T1, T2>)tdelegate;
#else #else

@ -708,7 +708,11 @@ namespace Google.ProtocolBuffers
{ {
// Explicitly specify the invariant culture so that this code does not break when // Explicitly specify the invariant culture so that this code does not break when
// executing in Turkey. // executing in Turkey.
#if PORTABLE_LIBRARY
String lowerName = name.ToLowerInvariant(); String lowerName = name.ToLowerInvariant();
#else
String lowerName = name.ToLower(FrameworkPortability.InvariantCulture);
#endif
field = type.FindDescriptor<FieldDescriptor>(lowerName); field = type.FindDescriptor<FieldDescriptor>(lowerName);
// If the case-insensitive match worked but the field is NOT a group, // If the case-insensitive match worked but the field is NOT a group,
// TODO(jonskeet): What? Java comment ends here! // TODO(jonskeet): What? Java comment ends here!

Loading…
Cancel
Save