mingw-w64/mingw-w64-headers/include/delayimp.h
Pali Rohár 48cf32beae headers: Fix compile warning: FACILITY_VISUALCPP redefined
Warning is:

    In file included from misc/delay-f.c:11:
    mingw-w64-headers/include/delayimp.h:64: warning: "FACILITY_VISUALCPP" redefined
     #define FACILITY_VISUALCPP ((LONG)0x6d)

    In file included from mingw-w64-headers/include/winbase.h:2817,
                     from mingw-w64-headers/include/windows.h:70,
                     from misc/delay-f.c:10:
    mingw-w64-headers/include/winerror.h:88: note: this is the location of the previous definition
     #define FACILITY_VISUALCPP 109

This same header from Visual Studio has such a definition commented out,
suggesting that it should be defined in winerror.h. We notice that delayimp.h
can't be used without including Windows SDK headers first, so don't redefine
`FACILITY_VISUALCPP` if one has already been defined.

Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-31 11:11:36 +08:00

71 lines
1.7 KiB
C

/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#define _DELAY_IMP_VER 2
#if defined(__cplusplus)
#define ExternC extern "C"
#else
#define ExternC extern
#endif
typedef IMAGE_THUNK_DATA *PImgThunkData;
typedef const IMAGE_THUNK_DATA *PCImgThunkData;
typedef DWORD RVA;
typedef struct ImgDelayDescr {
DWORD grAttrs;
RVA rvaDLLName;
RVA rvaHmod;
RVA rvaIAT;
RVA rvaINT;
RVA rvaBoundIAT;
RVA rvaUnloadIAT;
DWORD dwTimeStamp;
} ImgDelayDescr,*PImgDelayDescr;
typedef const ImgDelayDescr *PCImgDelayDescr;
enum DLAttr {
dlattrRva = 0x1
};
enum {
dliStartProcessing,dliNoteStartProcessing = dliStartProcessing,dliNotePreLoadLibrary,dliNotePreGetProcAddress,dliFailLoadLib,
dliFailGetProc,dliNoteEndProcessing
};
typedef struct DelayLoadProc {
WINBOOL fImportByName;
__C89_NAMELESS union {
LPCSTR szProcName;
DWORD dwOrdinal;
};
} DelayLoadProc;
typedef struct DelayLoadInfo {
DWORD cb;
PCImgDelayDescr pidd;
FARPROC *ppfn;
LPCSTR szDll;
DelayLoadProc dlp;
HMODULE hmodCur;
FARPROC pfnCur;
DWORD dwLastError;
} DelayLoadInfo,*PDelayLoadInfo;
typedef FARPROC (WINAPI *PfnDliHook)(unsigned dliNotify,PDelayLoadInfo pdli);
ExternC WINBOOL WINAPI __FUnloadDelayLoadedDLL2(LPCSTR szDll);
ExternC HRESULT WINAPI __HrLoadAllImportsForDll(LPCSTR szDll);
#ifndef FACILITY_VISUALCPP
#define FACILITY_VISUALCPP ((LONG)0x6d)
#endif
#define VcppException(sev,err) ((sev) | (FACILITY_VISUALCPP<<16) | err)
ExternC PfnDliHook __pfnDliNotifyHook2;
ExternC PfnDliHook __pfnDliFailureHook2;