回答
這是在OpenOffice.org中使用的#define
。它在sal/inc/sal/types.h
中定義爲以下之一:
#define SAL_CALL
#define SAL_CALL __cdecl
取決於正在編譯的平臺。只有當定義_MSC_VER
(對於Microsoft)時,它纔會被設置爲後者。
它指定的功能,如時使用:
virtual void SAL_CALL acquire() throw() { ++m_nRefCount; }
這將是演變成:
virtual void acquire() throw() { ++m_nRefCount; }
定期編譯器和:
virtual void __cdecl acquire() throw() { ++m_nRefCount; }
微軟。
至於什麼__cdecl
意味着微軟編譯器,看here,下面提取:
微軟具體
這是C和C++程序的默認調用約定。由於堆棧由調用者清理,因此可以執行vararg
函數。 __cdecl
調用約定會創建比__stdcall
更大的可執行文件,因爲它要求每個函數調用都包含堆棧清理代碼。以下列表顯示了此調用約定的實現。
+------------------------+----------------------------+
| Element | Implementation |
+------------------------+----------------------------+
| Argument-passing order | Right to left |
+------------------------+----------------------------+
| Stack-maintenance | Calling function pops the |
| responsibility | arguments from the stack |
+------------------------+----------------------------+
| Name-decoration | Underscore character (_) |
| convention | is prefixed to names |
+------------------------+----------------------------+
| Case-translation | No case translation |
| convention | performed |
+------------------------+----------------------------+
+1這是一個偉大的答案。 – templatetypedef 2011-02-24 07:42:46
非常感謝... definitly它會幫助我.. – balaji 2011-02-24 07:48:56
這對C++沒什麼特別的。這是某種特定於項目的預處理器宏。我猜想這是某種特殊的通話慣例。我發現one preprocessor macro in the Linux kernel,這似乎是某種64位優化調用約定。根據該文件頂部的註釋,「SAL」代表「系統抽象層」。
感謝回覆... – balaji 2011-02-24 06:48:59
- 1. 什麼是C++中的ScopeGuard?
- 2. 什麼是C#中的int?
- 3. C中的isatty()是什麼?
- 4. 什麼是C中的「-1L」?
- 5. 什麼是C#中的CreateNewAttribute?
- 6. 什麼是C#中的0xFF?
- 7. Objective-C中的'^'是什麼
- 8. C++中的`&|是什麼?
- 9. 什麼是C#中的[]?
- 10. c#中的sprintf是什麼?
- 11. 什麼是C#中的[....]
- 12. 什麼?在C#中是什麼意思?
- 13. 什麼是C++中的「copy c-or」?
- 14. 什麼是C#
- 15. C++:什麼是
- 16. 什麼是C#
- 17. 什麼是C++
- 18. C&C++中的'&'是什麼,它在perl中的等價操作符是什麼?
- 19. 什麼是[和]在C#中?
- 20. 什麼是<?=在C++中?
- 21. C++中'\ 0'是什麼?
- 22. 什麼是|在C#中?
- 23. 是什麼在C#中
- 24. 什麼是makefile的C++的
- 25. 在c/C++中,^ =是什麼意思?
- 26. 什麼是在C#
- 27. 是什麼在C#
- 28. 什麼是&&在C++
- 29. 這是什麼? '[C]: ?'
- 30. 什麼是用C
這個問題,它的事實,證據充分的,upvoted回答,對我很直接有用的。這似乎不太可能引起辯論等 – 2016-09-04 22:55:57