#pragma prefast 這東西可以用來壓抑不想要的 warning message...
http://msdn.microsoft.com/en-us/library/ms933054.aspx
星期四, 1月 14, 2010
星期一, 9月 28, 2009
Microsoft Specfic _inline, __inline, __forceinline.
http://msdn.microsoft.com/zh-tw/library/z8y1yy88.aspx
- _inline = __inline = inline.
- inline 是 C++ Standard, _inline, __inline, __forceinline 是 Microsoft Specfic.
- Microsoft 的 _inline, __inline, __forceinline 可使用在 C 裡面.
- inline function 是否真正會有作用, 是與 compiler 處理有關, 通常要加上最佳化函數才有效.
- 遞迴不會 inline, 除非加上 #pragma inline_recursion(on), 限制為 16 層.
- 其實 inline 不一定會增加效率. (重要)
Microsoft Specific
The __inline keyword is equivalent to inline.
Even with __forceinline, the compiler cannot inline code in all circumstances. The compiler cannot inline a function if:
The function or its caller is compiled with /Ob0 (the default option for debug builds).
The function and the caller use different types of exception handling (C++ exception handling in one, structured exception handling in the other).
The function has a variable argument list.
The function uses inline assembly, unless compiled with /Og, /Ox, /O1, or /O2.
The function is recursive and not accompanied by #pragma inline_recursion(on). With the pragma, recursive functions are inlined to a default depth of 16 calls. To reduce the inlining depth, use inline_depth pragma.
The function is virtual and is called virtually. Direct calls to virtual functions can be inlined.
The program takes the address of the function and the call is made via the pointer to the function. Direct calls to functions that have had their address taken can be inlined.
The function is also marked with the naked __declspec modifier.
If the compiler cannot inline a function declared with __forceinline, it generates a level 1 warning.
Recursive functions can be substituted inline to a depth specified by the inline_depth pragma, up to a maximum of 16 calls. After that depth, recursive function calls are treated as calls to an instance of the function. The depth to which recursive functions are examined by the inline heuristic cannot exceed 16. The inline_recursion pragma controls the inline expansion of a function currently under expansion. See the Inline-Function Expansion (/Ob) compiler option for related information.
END Microsoft Specific
星期三, 9月 16, 2009
The differences between L"Text", _T("Text") and TEXT("Text")
The differences between L"Text", _T("Text") and TEXT("Text"):
- _T("Text") and TEXT("Text") is a narrow-character (ASCII) literal in an ANSI build but a wide character (UNICODE) literal in a Unicode build.
- L"Text" is always a wide-character literal, regardless of pre-processor definitions.
- _T() and TEXT() are macros, the L prefix is part of the core C and C++ language lexical structure.
- There is no difference between _T() and TEXT(), both macro do same thing, only difference is _T() defines in tchar.h and TEXT() defines in windows.h.
星期一, 7月 06, 2009
VS2005 libcd.lib 找不到的解決方法
使用 VS2005 以上版本編譯 VC6 的專案時,如果發生 libcd.lib 找不到的錯誤,可以試試:
project properties... -> Configuration Properties -> Linker
-> Input -> Ignore Specific Library -> and typed in: libcd.lib
project properties... -> Configuration Properties -> Linker
-> Input -> Ignore Specific Library -> and typed in: libcd.lib
訂閱:
文章 (Atom)