BCB中有什么宏可以获妈当前行号和文件名?

liskman 2005-05-24 08:56:59
BCB中有什么宏获取当前的行号,获取当前的文件名?
便于输出调试信息,报告确切的出错位置。
...全文
83 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
liskman 2005-05-24
  • 打赏
  • 举报
回复
谢谢
leonatcs 2005-05-24
  • 打赏
  • 举报
回复
当前行:__LINE__,当前文件:__FILE__

Macro Value Description

_ _BCOPT_ _ 1 Defined in any compiler that has an optimizer.
_ _BCPLUSPLUS_ _ 0x0560 Defined if you've selected C++ compilation; will increase in later releases.
_ _BORLANDC_ _ 0x0560 Version number.
_ _CDECL_ _ 1 Defined if Calling Convention is set to cdecl; otherwise undefined.
_CHAR_UNSIGNED 1 Defined by default indicating that the default char is unsigned char. Use the -K compiler option to undefine this macro.

_ _CODEGUARD_ _ Defined whenever one of the CodeGuard compiler options is used; otherwise it is undefined.
_ _CONSOLE_ _ 1 When defined, the macro indicates that the program is a console application.
_CPPUNWIND 1 Enable stack unwinding. This is true by default; use -xd- to disable.
_ _cplusplus 1 Defined if in C++ mode; otherwise, undefined.
_ _DATE_ _ String literal Date when processing began on the current file.

_ _DLL_ _ 1 Defined whenever the -WD compiler option is used; otherwise it is undefined.
_ _FILE_ _ String literal Name of the current file being processed.
_ _FLAT_ _ 1 Defined when compiling in 32-bit flat memory model.
_ _FUNC_ _ String literal Name of the current function being processed. More details.
_ _LINE_ _ Decimal constant Number of the current source file line being processed.

_M_IX86 0x12c Always defined. The default value is 300. You can change the value to 400 or 500 by using the /4 or /5 compiler options.
_ _MT_ _ 1 Defined only if the -tWM option is used. It specifies that the multithread library is to be linked.
_ _PASCAL_ _ 1 Defined if Calling Convention is set to Pascal; otherwise undefined.

_ _STDC_ _ 1 Defined if you compile with the -A compiler option; otherwise, it is undefined.
_ _TCPLUSPLUS_ _ 0x0560 Version number.
_ _TEMPLATES_ _ 1 Defined as 1 for C++ files (meaning that templates are supported); otherwise, it is undefined.
_ _TIME_ _ String literal Time when processing began on the current file.
_ _TLS_ _ 1 Thread Local Storage. Always true in C++Builder.
_ _TURBOC_ _ 0x0560 Will increase in later releases.

_WCHAR_T Defined only for C++ programs to indicate that wchar_t is an intrinsically defined data type.
_WCHAR_T_DEFINED Defined only for C++ programs to indicate that wchar_t is an intrinsically defined data type.
_Windows Defined for Windows-only code.
_ _WIN32_ _ 1 Defined for console and GUI applications.

注意,使用时_与_之间没有空格。

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧