两个库的头文件,同方法名(API名同)如何处理?
两个库的头文件,同方法名(API名同)如何处理?
我的CPP程序,引用了,两个头文件,debugapi.h (来自WDK8.0 -windows驱动开发SDK) , WinBase.h (Windows库)。这两个头文件库里, 有同名方法: OutputDebugString
我调试的时候,会调用 OutputDebugString
但事实上 这个两个头文件下都有这个函数。 我函数要调用, WinBase.h的 OutputDebugString, 但实际执行或go to definition 会都指向debugapi.h下的OutputDebugString。
求大虾指教!!!
以下复制了写,标准头文件里的一些定义。
/****************** debugapi.h 下的定义**************************/
WINBASEAPI
VOID
WINAPI
OutputDebugStringW(
_In_opt_ LPCWSTR lpOutputString
);
#ifdef UNICODE
#define OutputDebugString OutputDebugStringW
#else
#define OutputDebugString OutputDebugStringA
#endif // !UNICODE
/****************** WinBase.h下的定义**************************/
WINBASEAPI
VOID
WINAPI
OutputDebugStringA(
_In_opt_ LPCSTR lpOutputString
);
WINBASEAPI
VOID
WINAPI
OutputDebugStringW(
_In_opt_ LPCWSTR lpOutputString
);
#ifdef UNICODE
#define OutputDebugString OutputDebugStringW
#else
#define OutputDebugString OutputDebugStringA
#endif // !UNICODE
//////////////////////////////////////////////////////////////////////////////////////////////////////