1515namespace IronPython . Modules {
1616 public static partial class PythonSignal {
1717 [ SupportedOSPlatform ( "windows" ) ]
18- internal class NtSignalState : PythonSignalState {
19- //We use a single Windows event handler to process all signals. This handler simply
20- //delegates the work out to PySignalToPyHandler.
21- public NativeSignal . WinSignalsHandler WinAllSignalsHandlerDelegate ;
18+ private class NtSignalState : PythonSignalState {
19+ // We use a single Windows event handler to process all signals. This handler simply
20+ // delegates the work out to PySignalToPyHandler.
21+ public NativeWindowsSignal . WinSignalsHandler WinAllSignalsHandlerDelegate ;
22+
2223
2324 public NtSignalState ( PythonContext pc ) : base ( pc ) {
24- WinAllSignalsHandlerDelegate = new NativeSignal . WinSignalsHandler ( WindowsEventHandler ) ;
25- NativeSignal . SetConsoleCtrlHandler ( this . WinAllSignalsHandlerDelegate , true ) ;
25+ WinAllSignalsHandlerDelegate = new NativeWindowsSignal . WinSignalsHandler ( WindowsEventHandler ) ;
26+ NativeWindowsSignal . SetConsoleCtrlHandler ( this . WinAllSignalsHandlerDelegate , true ) ;
2627 }
2728
28- //Our implementation of WinSignalsHandler
29+
30+ // Our implementation of WinSignalsHandler
2931 private bool WindowsEventHandler ( uint winSignal ) {
3032 bool retVal ;
3133 int pySignal ;
@@ -55,27 +57,27 @@ private bool WindowsEventHandler(uint winSignal) {
5557 int tempId = ( int ) PySignalToPyHandler [ pySignal ] ;
5658
5759 if ( tempId == SIG_DFL ) {
58- //SIG_DFL - we let Windows do whatever it normally would
60+ // SIG_DFL - we let Windows do whatever it normally would
5961 retVal = false ;
6062 } else if ( tempId == SIG_IGN ) {
61- //SIG_IGN - we do nothing, but tell Windows we handled the signal
63+ // SIG_IGN - we do nothing, but tell Windows we handled the signal
6264 retVal = true ;
6365 } else {
6466 throw new Exception ( "unreachable" ) ;
6567 }
6668 } else if ( PySignalToPyHandler [ pySignal ] == default_int_handler ) {
6769 if ( pySignal != SIGINT ) {
68- //We're dealing with the default_int_handlerImpl which we
69- //know doesn't care about the frame parameter
70+ // We're dealing with the default_int_handlerImpl which we
71+ // know doesn't care about the frame parameter
7072 retVal = true ;
7173 default_int_handlerImpl ( pySignal , null ) ;
7274 } else {
73- //Let the real interrupt handler throw a KeyboardInterrupt for SIGINT.
74- //It handles this far more gracefully than we can
75+ // Let the real interrupt handler throw a KeyboardInterrupt for SIGINT.
76+ // It handles this far more gracefully than we can
7577 retVal = false ;
7678 }
7779 } else {
78- //We're dealing with a callable matching PySignalHandler's signature
80+ // We're dealing with a callable matching PySignalHandler's signature
7981 retVal = true ;
8082 PySignalHandler temp = ( PySignalHandler ) Converter . ConvertToDelegate ( PySignalToPyHandler [ pySignal ] ,
8183 typeof ( PySignalHandler ) ) ;
@@ -98,7 +100,9 @@ private bool WindowsEventHandler(uint winSignal) {
98100 }
99101 }
100102
101- internal static class NativeSignal {
103+
104+ [ SupportedOSPlatform ( "windows" ) ]
105+ internal static class NativeWindowsSignal {
102106 // Windows API expects to be given a function pointer like this to handle signals
103107 internal delegate bool WinSignalsHandler ( uint winSignal ) ;
104108
0 commit comments