srcrelincludes. NXP CodeWarrior Development Studio
Oglas
Oglas
Chapter 32 Pragmas for Preprocessing
Remarks
This pragma is useful for keeping the starting column aligned with the original source code, though the compiler attempts to preserve space within the line. This pragma does not apply to expanded macros.
By default, this pragma is off
.
32.19 srcrelincludes
Controls the lookup of
#include
files.
Syntax
#pragma srcrelincludes on | off | reset
Remarks
When on
, the compiler looks for
#include
files relative to the previously included file (not just the source file). When off
, the compiler uses the CodeWarrior IDE's access paths or the access paths specified with the
-ir
option.
Use this pragma when multiple files use the same file name and are intended to be included by another header file in that directory. This is a common practice in UNIX programming.
This pragma corresponds to the Source-relative includes option in the Access Paths panel.By default, this pragma is off
.
32.20 syspath_once
Controls how included files are treated when
#pragmaonce
is enabled.
Syntax
#pragma syspath_once on | off | reset
Remarks
When this pragma and pragma once
are set to on
, the compiler distinguishes between identically-named header files referred to in
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
Freescale Semiconductor, Inc.
497
syspath_once
#include <
file-name
> and
#include "
file-name
" .
When this pragma is off
and pragma once is on
, the compiler will ignore a file that uses a
#include <file-name> directive if it has previously encountered another directive of the form
#include "file-name" for an identically-named header file.
shows an example.
This pragma does not correspond to any panel setting. By default, this setting is on
.
Listing 32-3. Pragma syspath_once example
#pragma syspath_once off
#pragma once on /* Include all subsequent files only once. */
#include "sock.h"
#include <sock.h> /* Skipped because syspath_once is off. */
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
498 Freescale Semiconductor, Inc.
Preuzimanje
Oglas