Skip to content

Commit 2367dca

Browse files
committed
Disable invalid parameter handler use under mingw
Mingw doesn't support the invalid parameter handler function in the same way as visual studio. Shouldn't be needed under mingw anyway.
1 parent 9fa44f0 commit 2367dca

File tree

1 file changed

+6
-2
lines changed
  • contrib/win32/win32compat

1 file changed

+6
-2
lines changed

contrib/win32/win32compat/sfds.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static int sfd_map_init = 0;
5555
static int sfd_count = 0;
5656
int sfd_start = 0;
5757

58-
58+
#ifndef __MINGW32__
5959
void myInvalidParameterHandler(const wchar_t* expression,
6060
const wchar_t* function,
6161
const wchar_t* file,
@@ -64,6 +64,7 @@ void myInvalidParameterHandler(const wchar_t* expression,
6464
{
6565
return;
6666
}
67+
#endif
6768

6869

6970
/*
@@ -151,14 +152,17 @@ int allocate_sfd(int fd_or_handle)
151152
else
152153
#endif
153154

154-
155+
#ifndef __MINGW32__
155156
_invalid_parameter_handler oldHandler, newHandler;
156157
newHandler = myInvalidParameterHandler;
157158
oldHandler = _set_invalid_parameter_handler(newHandler);
159+
#endif
158160

159161

160162
real_handle = (HANDLE)_get_osfhandle(fd_or_handle);
163+
#ifndef __MINGW32__
161164
_set_invalid_parameter_handler(oldHandler);
165+
#endif
162166

163167
if (real_handle == INVALID_HANDLE_VALUE)
164168
{

0 commit comments

Comments
 (0)