Change ifdefs to be by feature, not by platform (#1146)
* First pass * Second pass * Third pass * Temporarily change build script to build only portable * Add portable features for release build * Add feature constants to build script * Add more feature constants to build script * Fix build issues * Fix build issues * Get rid of constants in build.ps1 * HAVE_NUMERICS -> HAVE_BIG_INTEGER * Remove HAVE_NULLABLE * Remove HAVE_NUMERICS from csprojs * Add missing ifdef * Add feature defines to pj * Re-enable netstd builds * Fix defines in pj * Trying to get better build outputs * Trying to get the build error * Use newer cli * Address review feedback; make netstd build work * Introduce HAVE_DB_NULL_TYPE * Adapt to upstream changes; address remaining review feedback * Adapt to upstream changes; address remaining review feedback * Rename some constants for constistency * Address review feedback * -Fixed build with signed assembly * Fix merge erorr * Address review feedback * Introduce HAVE_NON_SERIALIZED_ATTRIBUTE * HAVE_IGNORE_DATA_MEMBER_ATTRIBUTE
This commit is contained in:
committed by
James Newton-King
parent
eb96cb9f62
commit
b8e60c773b
@@ -25,7 +25,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !(PORTABLE || PORTABLE40 || NET35 || NET20) || NETSTANDARD1_1
|
||||
#if HAVE_BIG_INTEGER
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Reflection;
|
||||
@@ -34,7 +34,7 @@ using System.Globalization;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization.Formatters;
|
||||
using System.Text;
|
||||
#if NET20
|
||||
#if !HAVE_LINQ
|
||||
using Newtonsoft.Json.Utilities.LinqBridge;
|
||||
#else
|
||||
using System.Linq;
|
||||
@@ -87,7 +87,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
|
||||
static ReflectionUtils()
|
||||
{
|
||||
#if !(PORTABLE40 || PORTABLE)
|
||||
#if HAVE_EMPTY_TYPES
|
||||
EmptyTypes = Type.EmptyTypes;
|
||||
#else
|
||||
EmptyTypes = CollectionUtils.ArrayEmpty<Type>();
|
||||
@@ -1106,13 +1106,13 @@ namespace Newtonsoft.Json.Utilities
|
||||
return 0m;
|
||||
case PrimitiveTypeCode.DateTime:
|
||||
return new DateTime();
|
||||
#if !(PORTABLE || PORTABLE40 || NET35 || NET20) || NETSTANDARD1_1
|
||||
#if HAVE_BIG_INTEGER
|
||||
case PrimitiveTypeCode.BigInteger:
|
||||
return new BigInteger();
|
||||
#endif
|
||||
case PrimitiveTypeCode.Guid:
|
||||
return new Guid();
|
||||
#if !NET20
|
||||
#if HAVE_DATE_TIME_OFFSET
|
||||
case PrimitiveTypeCode.DateTimeOffset:
|
||||
return new DateTimeOffset();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user