Skip to content

Commit ccb8a0c

Browse files
committed
CSHARP-1707: Switch to using standard NETSTANDARD1_6 preprocessor symbol.
1 parent f345389 commit ccb8a0c

File tree

57 files changed

+86
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+86
-86
lines changed

src/MongoDB.Bson.Dotnet/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"compile": {
1616
"include": [ "../MongoDB.Bson/**/*.cs", "../MongoDB.Shared/Hasher.cs" ]
1717
},
18-
"define": [ "DEBUG", "TRACE", "NETSTANDARD16" ],
18+
"define": [ "DEBUG", "TRACE" ],
1919
"outputName" : "MongoDB.Bson"
2020
}
2121
}

src/MongoDB.Bson/IO/BsonReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public virtual IByteBuffer ReadRawBsonArray()
276276
bsonWriter.WriteEndDocument();
277277

278278
byte[] memoryStreamBuffer;
279-
#if NETSTANDARD16
279+
#if NETSTANDARD1_6
280280
memoryStreamBuffer = memoryStream.ToArray();
281281
#else
282282
memoryStreamBuffer = memoryStream.GetBuffer();

src/MongoDB.Bson/IO/BsonStreamAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public override ArraySegment<byte> ReadCStringBytes()
296296
if (b == 0)
297297
{
298298
byte[] memoryStreamBuffer;
299-
#if NETSTANDARD16
299+
#if NETSTANDARD1_6
300300
memoryStreamBuffer = memoryStream.ToArray();
301301
#else
302302
memoryStreamBuffer = memoryStream.GetBuffer();

src/MongoDB.Bson/ObjectModel/ObjectId.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public static void Unpack(byte[] bytes, out int timestamp, out int machine, out
377377
// private static methods
378378
private static int GetAppDomainId()
379379
{
380-
#if NETSTANDARD16
380+
#if NETSTANDARD1_6
381381
return 1;
382382
#else
383383
return AppDomain.CurrentDomain.Id;
@@ -392,7 +392,7 @@ private static int GetAppDomainId()
392392
[MethodImpl(MethodImplOptions.NoInlining)]
393393
private static int GetCurrentProcessId()
394394
{
395-
#if NETSTANDARD16
395+
#if NETSTANDARD1_6
396396
return 1;
397397
#else
398398
return Process.GetCurrentProcess().Id;
@@ -408,7 +408,7 @@ private static int GetMachineHash()
408408

409409
private static string GetMachineName()
410410
{
411-
#if NETSTANDARD16
411+
#if NETSTANDARD1_6
412412
return Environment.GetEnvironmentVariable("COMPUTERNAME") ?? "";
413413
#else
414414
return Environment.MachineName;

src/MongoDB.Bson/Serialization/AttributedSerializationProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public override IBsonSerializer GetSerializer(Type type, IBsonSerializerRegistry
3939
throw new ArgumentException(message, "type");
4040
}
4141

42-
#if NETSTANDARD16
42+
#if NETSTANDARD1_6
4343
var serializerAttributes = typeInfo.GetCustomAttributes(typeof(BsonSerializerAttribute), false).ToArray(); // don't inherit
4444
#else
4545
var serializerAttributes = typeInfo.GetCustomAttributes(typeof(BsonSerializerAttribute), false); // don't inherit

src/MongoDB.Bson/Serialization/BsonClassMap.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ private Func<object> GetCreator()
12681268
}
12691269
else
12701270
{
1271-
#if NETSTANDARD16
1271+
#if NETSTANDARD1_6
12721272
var message = $"Type '{_classType.GetType().Name}' does not have a default constructor.";
12731273
throw new BsonSerializationException(message);
12741274
#else
@@ -1537,7 +1537,7 @@ public void UnmapProperty<TMember>(Expression<Func<TClass, TMember>> propertyLam
15371537
// private static methods
15381538
private static MethodInfo[] GetPropertyAccessors(PropertyInfo propertyInfo)
15391539
{
1540-
#if NETSTANDARD16
1540+
#if NETSTANDARD1_6
15411541
var accessors = new List<MethodInfo>();
15421542
if (propertyInfo.GetMethod != null)
15431543
{
@@ -1593,7 +1593,7 @@ private static PropertyInfo FindPropertyImplementation(PropertyInfo interfacePro
15931593
{
15941594
var interfaceType = interfacePropertyInfo.DeclaringType;
15951595

1596-
#if NETSTANDARD16
1596+
#if NETSTANDARD1_6
15971597
var actualTypeInfo = actualType.GetTypeInfo();
15981598
var bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public;
15991599
var actualTypePropertyInfos = actualTypeInfo.GetMembers(bindingFlags).OfType<PropertyInfo>();

src/MongoDB.Bson/Serialization/BsonSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ internal static void EnsureKnownTypesAreRegistered(Type nominalType)
691691
if (!__typesWithRegisteredKnownTypes.Contains(nominalType))
692692
{
693693
// only call LookupClassMap for classes with a BsonKnownTypesAttribute
694-
#if NETSTANDARD16
694+
#if NETSTANDARD1_6
695695
var knownTypesAttribute = nominalType.GetTypeInfo().GetCustomAttributes(typeof(BsonKnownTypesAttribute), false).ToArray();
696696
#else
697697
var knownTypesAttribute = nominalType.GetTypeInfo().GetCustomAttributes(typeof(BsonKnownTypesAttribute), false);

src/MongoDB.Bson/Serialization/IdGenerators/AscendingGuidGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public bool IsEmpty(object id)
141141
[MethodImpl(MethodImplOptions.NoInlining)]
142142
private static int GetCurrentProcessId()
143143
{
144-
#if NETSTANDARD16
144+
#if NETSTANDARD1_6
145145
return 1;
146146
#else
147147
return Process.GetCurrentProcess().Id;
@@ -158,7 +158,7 @@ private static byte[] GetMachineHash()
158158

159159
private static string GetMachineName()
160160
{
161-
#if NETSTANDARD16
161+
#if NETSTANDARD1_6
162162
return Environment.GetEnvironmentVariable("COMPUTERNAME") ?? "";
163163
#else
164164
return Environment.MachineName;

src/MongoDB.Bson/Serialization/Serializers/CultureInfoSerializer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected override CultureInfo DeserializeValue(BsonDeserializationContext conte
7373
case Flags.UseUserOverride: useUserOverride = _booleanSerializer.Deserialize(context); break;
7474
}
7575
});
76-
#if NETSTANDARD16
76+
#if NETSTANDARD1_6
7777
if (!useUserOverride)
7878
{
7979
throw new FormatException("CultureInfo does not support useUserOverride on this version of the .NET Framework.");
@@ -101,7 +101,7 @@ protected override void SerializeValue(BsonSerializationContext context, BsonSer
101101
{
102102
var bsonWriter = context.Writer;
103103

104-
#if NETSTANDARD16
104+
#if NETSTANDARD1_6
105105
var useUserOverride = true;
106106
#else
107107
var useUserOverride = value.UseUserOverride;

src/MongoDB.Driver.Core.Dotnet/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"compile": {
2020
"include": [ "../MongoDB.Driver.Core/**/*.cs", "../MongoDB.Shared/Hasher.cs" ]
2121
},
22-
"define": [ "DEBUG", "TRACE", "NETSTANDARD16" ],
22+
"define": [ "DEBUG", "TRACE" ],
2323
"outputName" : "MongoDB.Driver.Core"
2424
}
2525
}

0 commit comments

Comments
 (0)