Skip to content

Commit

Permalink
Pull in HANDLE.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsnowcurrently committed Dec 12, 2022
1 parent 57dc4a8 commit 08799ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
19 changes: 13 additions & 6 deletions Include/internal/pycore_signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ extern "C" {
#include "pycore_atomic.h" // _Py_atomic_address

#ifdef MS_WINDOWS
# ifndef SOCKET
# ifdef PYCORE_SIGNAL_REQUIRES_WINSOCK
# ifdef PYCORE_SIGNAL_WITH_PRE_INCLUDES
# ifndef SOCKET
# error "<winsock2.h> must be included before this header"
# endif
# endif
# ifndef HANDLE
# error "<windows.h> must be included before this header"
# ifndef HANDLE
# error "<windows.h> must be included before this header"
# endif
# endif
#endif
#include <signal.h> // NSIG
Expand Down Expand Up @@ -62,7 +62,8 @@ struct _signals_runtime_state {
# ifdef SOCKET
SOCKET fd;
# else
// <winsock2.h> wasn't included already, so we fake it.
// <winsock2.h> wasn't included already,
// we use something compatible with SOCKET.
int fd;
# endif
#elif defined(__VXWORKS__)
Expand All @@ -84,7 +85,13 @@ struct _signals_runtime_state {
PyObject *default_handler;
PyObject *ignore_handler;
#ifdef MS_WINDOWS
# ifdef HANDLE
HANDLE sigint_event;
# else
// <windows.h> wasn't included already,
// we use something compatible with HANDLE.
void *sigint_event;
# endif
#endif

/* True if the main interpreter thread exited due to an unhandled
Expand Down
4 changes: 2 additions & 2 deletions Modules/signalmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#ifdef MS_WINDOWS
# if !defined(SOCKET) && defined(Py_INTERNAL_SIGNAL_H)
# error "pycore_signal.h included without PYCORE_SIGNAL_REQUIRES_WINSOCK"
# error "pycore_signal.h included without PYCORE_SIGNAL_WITH_PRE_INCLUDES"
# endif
# define _PYCORE_SIGNAL_REQUIRES_WINSOCK
# define PYCORE_SIGNAL_WITH_PRE_INCLUDES
#endif

#include "Python.h"
Expand Down

0 comments on commit 08799ad

Please sign in to comment.