Header guard style
Style of preprocessor directive in generated code
Description
App Configuration Pane: Code Appearance
Configuration Objects: coder.CodeConfig | coder.EmbeddedCodeConfig
To prevent compilation errors due to multiple inclusion of header files, the code
generator produces either #ifndef or #pragma once
constructs in generated header files. If your project uses distinct files that use the
same preprocessor macros, then generate code with the #pragma once
construct. The compilation behavior of #pragma once is not
standardized.
Settings
Use include guardThis setting is the default setting.
The code generator produces
#ifndefstyle#includeguards.Use pragma onceThe code generator produces
#pragma oncestyle#includeguards.
Programmatic Use
Property:
HeaderGuardStyle |
Values: UseIncludeGuard |
UsePragmaOnce |
Default:
UseIncludeGuard |
Version History
Introduced in R2019b