Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
fix: wdmsec.lib conflict.
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroKaku committed Jul 18, 2022
1 parent 6471f74 commit bae1887
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
18 changes: 14 additions & 4 deletions src/ucrt/misc/invalid_parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// The invalid parameter handlers and related functionality
//
#include <corecrt_internal.h>
#include <vcstartup_internal.h>


static _invalid_parameter_handler __acrt_invalid_parameter_handler;
Expand Down Expand Up @@ -48,7 +49,7 @@ extern "C" void __cdecl _invalid_parameter_internal(
_invoke_watson(expression, function_name, file_name, line_number, reserved);
}

extern "C" void __cdecl _invalid_parameter(
extern "C" void __cdecl _invalid_parameter_default(
wchar_t const* const expression,
wchar_t const* const function_name,
wchar_t const* const file_name,
Expand All @@ -59,28 +60,35 @@ extern "C" void __cdecl _invalid_parameter(
return _invalid_parameter_internal(expression, function_name, file_name, line_number, reserved);
}

extern "C" void __cdecl _invalid_parameter_noinfo()
extern "C" void __cdecl _invalid_parameter_noinfo_default()
{
_invalid_parameter(nullptr, nullptr, nullptr, 0, 0);
}

// This is used by inline code in the C++ Standard Library and the SafeInt
// library. Because it is __declspec(noreturn), the compiler can better
// optimize use of the invalid parameter handler for inline code.
extern "C" __declspec(noreturn) void __cdecl _invalid_parameter_noinfo_noreturn()
extern "C" __declspec(noreturn) void __cdecl _invalid_parameter_noinfo_noreturn_default()
{
_invalid_parameter(nullptr, nullptr, nullptr, 0, 0);
_invoke_watson (nullptr, nullptr, nullptr, 0, 0);
}

_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter, _invalid_parameter_default);
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter_noinfo, _invalid_parameter_noinfo_default);
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter_noinfo_noreturn, _invalid_parameter_noinfo_noreturn_default);

static auto _invalid_parameter_dummy = &_invalid_parameter;
static auto _invalid_parameter_noinfo_dummy = &_invalid_parameter_noinfo;
static auto _invalid_parameter_noinfo_noreturn_dummy = &_invalid_parameter_noinfo_noreturn;


//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//
// _invoke_watson
//
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
extern "C" __declspec(noreturn) void __cdecl _invoke_watson(
extern "C" __declspec(noreturn) void __cdecl _invoke_watson_default(
wchar_t const* const expression,
wchar_t const* const function_name,
wchar_t const* const file_name,
Expand All @@ -97,6 +105,8 @@ extern "C" __declspec(noreturn) void __cdecl _invoke_watson(
__fastfail(FAST_FAIL_INVALID_ARG);
}

_VCRT_DECLARE_ALTERNATE_NAME(_invoke_watson, _invoke_watson_default);
static auto _invoke_watson_dummy = &_invoke_watson;


//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Expand Down
2 changes: 1 addition & 1 deletion src/ucrt/misc/terminate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include <corecrt_terminate.h>
#include <vcstartup_internal.h>


// fix: abort not implemented after 19043
// alternatename: https://devblogs.microsoft.com/oldnewthing/20200731-00/?p=104024

extern "C" void __cdecl _abort_default();
_VCRT_DECLARE_ALTERNATE_NAME(abort, _abort_default);

Expand Down
1 change: 1 addition & 0 deletions src/ucrt/startup/abort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ extern "C" void __cdecl _abort_default()
__fastfail(FAST_FAIL_FATAL_APP_EXIT);
}


/***
*unsigned int _set_abort_behavior(unsigned int, unsigned int) - set the behavior on abort
*
Expand Down
2 changes: 1 addition & 1 deletion veil
Submodule veil updated from 623338 to 909d4c

0 comments on commit bae1887

Please sign in to comment.