C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Preprocessor Directives and Macros
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
12-16
Preprocessor Operators
#if __TANDEM_ARCH_ != 0
printf ("Native system, not TNS\n");
#endif
The _IGNORE_LOCALE macro selects macros that support only the C/POSIX locale
instead of internationalized functions that support multiple locales. The
_IGNORE_LOCALE macro affects functions in the ctypeh or ctype.h header file.
The native compilers provide four additional feature-test macros. Unlike the previously
described feature-test macros, these four macros do not determine whether a
particular set of features will be included from header files. Instead, these feature-test
macros are intended to isolate code by the environment in which it can be run.
The _IEEE_FLOAT macro is automatically defined by the native C and C++ compilers
if IEEE floating-point format has been specified. For more details, see the pragma
IEEE_FLOAT on page 13-44.
The ENV pragma setting determines which of these native mode feature-test macros is
defined:
These feature-test macros cannot be used to ensure that a C run-time library call can
be made in a particular environment. For more details, see the description of pragma
ENV on page 13-20.
Preprocessor Operators
There are two preprocessor operators, # and ##. The # operator allows you to create a
character string literal when the operator precedes a formal parameter in a macro
definition. The ## operator allows you to concatenate two tokens in a macro definition.
Both of these operators are used in the context of the #define directive.
Operator #
The unary operator # is used only with function-like macros, which take arguments. If
the # operator precedes a formal parameter in the macro definition, the actual
_COMMON Identifies code that runs with pragma ENV COMMON set. Pragma ENV
COMMON is the default setting. Such code runs in the user code space
and requires the Common Run-Time Environment (CRE).
_EMBEDDED Identifies code that runs with pragma ENV EMBEDDED set. Such code
runs in the system code space and cannot use the Common Run-
Time Environment (CRE).
_LIBRARY Identifies code that runs with pragma ENV LIBRARY set. Such code
runs in the user library space and requires the Common Run-Time
Environment (CRE).
_LIBSPACE Identifies code that runs with pragma ENV LIBSPACE set. Such code
runs in the user library or system library space and cannot use the
Common Run-Time Environment (CRE).