Squashed 'ext/detours/' changes from 39aa864..36b69b9

36b69b9 Make Detours MinGW Clang-compatible

git-subtree-dir: ext/detours
git-subtree-split: 36b69b971888b2ca0c5913563bae011efaa4a42e
This commit is contained in:
Andrzej Janik
2021-01-03 17:54:01 +01:00
parent dabc40cb19
commit 4b96dbc8f4
4 changed files with 7 additions and 21 deletions

View File

@ -11,6 +11,7 @@
#define DETOURS_INTERNAL
#include "detours.h"
#include <stddef.h>
#include <strsafe.h>
#if DETOURS_VERSION != 0x4c0c1 // 0xMAJORcMINORcPATCH
#error detours.h version mismatch

View File

@ -118,11 +118,6 @@
//////////////////////////////////////////////////////////////////////////////
//
#if (_MSC_VER < 1299)
typedef LONG LONG_PTR;
typedef ULONG ULONG_PTR;
#endif
///////////////////////////////////////////////// SAL 2.0 Annotations w/o SAL.
//
// These definitions are include so that Detours will build even if the
@ -846,24 +841,10 @@ VOID CALLBACK DetourFinishHelperProcess(_In_ HWND,
//////////////////////////////////////////////////////////////////////////////
//
#if (_MSC_VER < 1299)
#include <imagehlp.h>
typedef IMAGEHLP_MODULE IMAGEHLP_MODULE64;
typedef PIMAGEHLP_MODULE PIMAGEHLP_MODULE64;
typedef IMAGEHLP_SYMBOL SYMBOL_INFO;
typedef PIMAGEHLP_SYMBOL PSYMBOL_INFO;
static inline
LONG InterlockedCompareExchange(_Inout_ LONG *ptr, _In_ LONG nval, _In_ LONG oval)
{
return (LONG)::InterlockedCompareExchange((PVOID*)ptr, (PVOID)nval, (PVOID)oval);
}
#else
#pragma warning(push)
#pragma warning(disable:4091) // empty typedef
#include <dbghelp.h>
#pragma warning(pop)
#endif
#ifdef IMAGEAPI // defined by DBGHELP.H
typedef LPAPI_VERSION (NTAPI *PF_ImagehlpApiVersionEx)(_In_ LPAPI_VERSION AppVersion);

View File

@ -146,6 +146,8 @@ protected:
DWORD m_cbAlloc;
};
class CImageImportName;
class CImageImportFile
{
friend class CImage;

View File

@ -12,6 +12,8 @@
// #define DETOUR_DEBUG 1
#define DETOURS_INTERNAL
#include "detours.h"
#include <strsafe.h>
#include <libloaderapi.h>
#if DETOURS_VERSION != 0x4c0c1 // 0xMAJORcMINORcPATCH
#error detours.h version mismatch
@ -340,7 +342,7 @@ PVOID WINAPI DetourGetEntryPoint(_In_opt_ HMODULE hModule)
}
SetLastError(NO_ERROR);
return GetProcAddress(hClr, "_CorExeMain");
return (PVOID)GetProcAddress(hClr, "_CorExeMain");
}
SetLastError(NO_ERROR);