VC2005編譯錯誤:error C2146: 語法錯誤 : 缺乏「;」(在標識符「PVOID...

vs就是坑爹啊,各個版本就不能兼容的好點兒嗎?!dom

 error C2146: 語法錯誤 : 缺乏「;」(在標識符「PVOID64」的前面)spa

http://freedomszp.spaces.live.com/blog/cns!767067FF9841D7D1!187.entrycode

 改動SDK的頭文件,不是一個好的辦法,會下降代碼的移植性。個人解決方法以下。zhanyonhublog

在stdafx.h的開頭,加上以下代碼:class

#ifndef POINTER_64

#if !defined(_MAC) && (defined(_M_MRX000) || defined(_M_AMD64) || defined(_M_IA64)) && (_MSC_VER >= 1100) && !(defined(MIDL_PASS) || defined(RC_INVOKED))

#define POINTER_64 __ptr64

typedef unsigned __int64 POINTER_64_INT;

#if defined(_WIN64)

#define POINTER_32 __ptr32

#else

#define POINTER_32

#endif

#else

#if defined(_MAC) && defined(_MAC_INT_64)

#define POINTER_64 __ptr64

typedef unsigned __int64 POINTER_64_INT;

#else

#if (_MSC_VER >= 1300) && !(defined(MIDL_PASS) || defined(RC_INVOKED))

#define POINTER_64 __ptr64

#else

#define POINTER_64

#endif

typedef unsigned long POINTER_64_INT;

#endif

#define POINTER_32

#endif

#endif
相關文章
相關標籤/搜索