-Cleaned up preprocessor symbols

This commit is contained in:
James Newton-King
2017-03-05 15:12:52 +13:00
parent febdb8188b
commit ba514c4610
85 changed files with 226 additions and 235 deletions
@@ -43,7 +43,7 @@ using Newtonsoft.Json.Serialization;
namespace Newtonsoft.Json.Utilities
{
#if (DOTNET || PORTABLE || PORTABLE40)
#if (DOTNET || PORTABLE)
internal enum MemberTypes
{
Property = 0,
@@ -790,13 +790,11 @@ namespace Newtonsoft.Json.Utilities
return (attributeType != null) ? Attribute.GetCustomAttributes(mi, attributeType, inherit) : Attribute.GetCustomAttributes(mi, inherit);
}
#if !PORTABLE40
Module m = provider as Module;
if (m != null)
{
return (attributeType != null) ? Attribute.GetCustomAttributes(m, attributeType, inherit) : Attribute.GetCustomAttributes(m, inherit);
}
#endif
ParameterInfo p = provider as ParameterInfo;
if (p != null)
@@ -804,14 +802,10 @@ namespace Newtonsoft.Json.Utilities
return (attributeType != null) ? Attribute.GetCustomAttributes(p, attributeType, inherit) : Attribute.GetCustomAttributes(p, inherit);
}
#if !PORTABLE40
ICustomAttributeProvider customAttributeProvider = (ICustomAttributeProvider)attributeProvider;
object[] result = (attributeType != null) ? customAttributeProvider.GetCustomAttributes(attributeType, inherit) : customAttributeProvider.GetCustomAttributes(inherit);
return (Attribute[])result;
#else
throw new Exception("Cannot get attributes from '{0}'.".FormatWith(CultureInfo.InvariantCulture, provider));
#endif
}
#else
public static T[] GetAttributes<T>(object attributeProvider, bool inherit) where T : Attribute