File tree 1 file changed +29
-0
lines changed
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 = OperatingSystemType . 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
+ switch ( RuntimeInformation . ProcessArchitecture )
405
+ {
406
+ case Architecture . X86 :
407
+ Machine = MachineType . i386 ;
408
+ break ;
409
+ case Architecture . X64 :
410
+ Machine = MachineType . x86_64 ;
411
+ break ;
412
+ case Architecture . Arm :
413
+ Machine = MachineType . armv7l ;
414
+ break ;
415
+ case Architecture . Arm64 :
416
+ Machine = MachineType . aarch64 ;
417
+ break ;
418
+ default :
419
+ Machine = MachineType . Other ;
420
+ break ;
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