File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -356,6 +356,7 @@ internal static void Initialize(bool initSigs = false)
356
356
/// </summary>
357
357
private static void InitializePlatformData ( )
358
358
{
359
+ #if ! NETSTANDARD
359
360
IntPtr op ;
360
361
IntPtr fn ;
361
362
IntPtr platformModule = PyImport_ImportModule ( "platform" ) ;
@@ -391,6 +392,34 @@ private static void InitializePlatformData()
391
392
MType = MachineType . Other ;
392
393
}
393
394
Machine = MType ;
395
+ #else
396
+ OperatingSystem = OperatingSystem . Other ;
397
+ if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
398
+ OperatingSystem = OperatingSystemType . Linux ;
399
+ else if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) )
400
+ OperatingSystem = OperatingSystemType . Darwin ;
401
+ else if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
402
+ OperatingSystem = OperatingSystemType . Windows ;
403
+
404
+ Machine = MachineType . Other ;
405
+ switch ( RuntimeInformation . ProcessArchitecture )
406
+ {
407
+ case Architecture . X86 :
408
+ Machine = MachineType . i386 ;
409
+ break ;
410
+ case Architecture . X64 :
411
+ Machine = MachineType . amd64 ;
412
+ break ;
413
+ case Architecture . Arm :
414
+ Machine = MachineType . armv7l ;
415
+ break ;
416
+ case Architecture . Arm64 :
417
+ Machine = MachineType . aarch64 ;
418
+ break ;
419
+ default :
420
+ Machine = MachineType . Other ;
421
+ }
422
+ #endif
394
423
}
395
424
396
425
internal static void Shutdown ( )
You can’t perform that action at this time.
0 commit comments