編碼的時候經常要用到條件編譯,每次都到網上去查比較浪費時間,今天總結一下以備後用
visual c++
#ifdef _msc_ver(非vc編譯器很多地方也有定義)
borland c++
#ifdef __borlandc__
unix
windows
windows 95/98/me的ver … _win32_windows
#if (_win32_windows >= 0x0400) // windows 95以上
#if (_win32_windows >= 0x0410) // windows 98以上
#if (_win32_windows >= 0x0500) // windows me以上
windows nt的ver … _win32_winnt
windows ce(pocketpc)
#ifdef _win32_wce
windows ce … winceosver
windows ce
wce_if
internet explorer的ver … _win32_ie
cygwin
條件編譯小結
源文 編碼的時候經常要用到條件編譯,每次都到網上去查比較浪費時間,今天總結一下以備後用 visual c ifdef msc ver 非vc編譯器很多地方也有定義 borland c ifdef borlandc unix windows windows 95 98 me的ver win32 win...
條件編譯 if
1 為什麼需要條件編譯 客戶的需求在不停地發生變化,一會兒需要這個功能,一會兒不需要這個功能。我們可以使用條件編譯來方便地裁剪功能。2 條件編譯語句 if 條件編譯語句 if的形式是 1 if expression 2.3 elif expression 4.5 elif expression 6....
if 條件編譯
1.格式 if constant expressionstatements elif constant expressionstatements else statements endif 其中 constant expression 常量表示式 字面值常量,或者乙個有 define定義的符號 由預...