Filename and line information
提供:cppreference.com
< cpp | preprocessor
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
直ちにディレクティブの後の行に現在のソースファイルに他のソース·ファイルが含まれています.
Original:
Includes other source file into current source file at the line immediately after the directive .
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] 構文
#line lineno
|
(1) | ||||||||
#line lineno "filename"
|
(2) | ||||||||
[編集] 説明
linenoへの変更現在のプリプロセッサの行番号を、このポイントを超えてマクロ__LINE__の展開がlinenoプラス以来遭遇した実際のソース·コードの行数に展開されます.
2) Original:
Changes the current preprocessor line number to lineno. Expansions of the macro __LINE__ beyond this point will expand to lineno plus the number of actual source code lines encountered since.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
またfilenameに現在のプリプロセッサファイル名を変更します。マクロの展開は__FILE__この点から生成されfilename.
Original:
Also changes the current preprocessor file name to filename. Expansions of the macro __FILE__ from this point will produce filename.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
彼らは必要に応じて有効な文字列を次の有効な10進整数に拡大していく。すべてプリプロセッサトークン(マクロ定数または式)を限り
#lineへの引数として許可されています.Original:
Any preprocessing tokens (macro constants or expressions) are permitted as arguments to
#line as long as they expand to a valid decimal integer optionally following a valid character string.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] ノート
このディレクティブはによって使用され別の言語で書かれたファイルからC + +のソースファイルを生成するいくつかのコードの自動生成ツール。その場合、
#lineディレクティブは、生成されたC + +のファイルを参照する行番号と元の(人間が編集可能な)ソースファイルのファイル名に挿入されるかもしれません。Original:
This directive is used by some automatic code generation tools which produce C++ source files from a file written in another language. In that case,
#line directives may be inserted in the generated C++ file referencing line numbers and the file name of the original (human-editable) source file.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例
#include <cassert> #define FNAME "test.cc" int main() { #line 777 FNAME assert(2+2 == 5); }
Output:
test: test.cc:777: int main(): Assertion `2+2 == 5' failed.