Preprocessor
Aus cppreference.com
< cpp
|
|
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. |
<metanoindex/>
Der Präprozessor wird vor dem Compiler aufgerufen. Das Ergebnis des Präprozessors ist eine Datei, die an den Compiler weitergeleitet wird.
Richtlinien
Die Präprozessordirektiven steuern das Verhalten des Präprozessors. Jede Anweisung belegt eine Zeile und hat folgendes Format:
#Charakter- Präprozessorinstruktion (eine von
define,undef,include,if,ifdef,ifndef,else,elif,endif,line,error,pragma)[1] - Argumente (abhängig von der Instruktion)
- Zeilenumbruch
Die Null-Richtlinie (# gefolgt von einen Zeilenumbruch) ist zulässig und hat keine Auswirkung.
Fähigkeiten
Die Übersetzung der Quelldatei kann durch den Präprozessor wie folgt gesteuert werden:
- 'bedingte' Kompilierung von Teilen der Quelldatei (gesteuert durch die RichtlinienOriginal:conditionallyThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.#if,#ifdef,#ifndef,#else,#elifund#endif) .Original:bedingtcompile of parts of source file (controlled by directiveOriginal:conditionallyThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.#if,#ifdef,#ifndef,#else,#elifand#endif).The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - ' replace' text Makros während möglicherweise Verkettung oder Quotierung von Bezeichnern (gesteuert durch Richtlinien
#defineund#undefund Operatoren#und##)Original:replace text macros while possibly concatenating or quoting identifiers (controlled by directives#defineand#undef, and operators#and##)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 'include' andere Dateien (gesteuert durch die Richtlinie
#include)Original:include other files (controlled by directive#include)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - erzeugen eine Warnung warning (gesteuert durch die Richtlinie
#warning)Original:cause a warning (controlled by directive#warning)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - erzeugen einen Fehler error (gesteuert durch die Richtlinie
#error)Original:cause an error (controlled by directive#error)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Das Verhalten des Präprozessors kann wie folgt gesteuert werden:
Original:
The following aspects of the preprocessor can be controlled:
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.
- 'Implementierung definiert' Verhalten (gesteuert durch die RichtlinienOriginal:implementation definedThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.#pragma)Original:Implementierung definiertbehavior (controlled by directivesOriginal:implementation definedThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.#pragma)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 'Dateinamen und Online-Informationen', die der Präprozessor (gesteuert durch RichtlinienOriginal:file name and line informationThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.#line)Original:Dateinamen und Online-Informationenavailable to the preprocessor (controlled by directivesOriginal:file name and line informationThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.#line)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Fussnoten
- ↑ Dies sind die Direktiven, die vomStandard definiert sind. Der Standard definiert kein Verhalten für ander Direktiven: sie könen ignoriert werden, eine sinnvolle Bedeutung haben oder einen Copilerfehler erzeugen. Auch wenn sie ignoriert werden, werden sie vom Quellcode entfernt wenn die Verarbeitung des Präprozessors abgeschlossen ist. Eine häufige nicht standardisierte Erweiterung ist die
#warningDirektive, die während der Compilation eine benutzerdefinierte Meldung ausgibt.