Quick Links: |
Provide macros for inserting SCM Ids into source files. More...
tag
as static_Pragma("once")
man ident
man strings
(strings -a
produces more verbose output) man mcs
(Solaris-only) BSLS_IDENT_ON
macro is defined at compilation time. By default, this macro is not defined, and ident strings are not added to object files. $
with (DOLLAR)
to avoid any expansion within this header file's documentation. '(DOLLAR)Id: bsls_ident.h 141104 2010-09-17 00:30:47Z mgiroux (DOLLAR)'
mgiroux
, and can be retrieved from the SCM system using revision 141104
. BSLS_IDENT_PRAGMA_ONCE
can optionally be used in headers and encapsulates a non-standard pragma (_Pragma("once")) supported on a number of platforms and which indicates that a header should only be included and parsed once. Use of this macro can help reduce compile times by eliminating extraneous I/O when headers are included more than once in the same translation unit. Note that this macro should not be used for any header that cannot use include guards: this is unusual, but can happen for certain low-level headers. BSLS_IDENT(identifier)
This macro inserts the specified identifier
into the object's .comment
section, if supported on the current platform.BSLS_IDENT_RCSID(tag, identifier)
This macro inserts the specified identifier
into the object, using BSLS_IDENT
, if possible on the current platform. If BSLS_IDENT
is not available, the specified tag
may be used to declare a static char array containing the tag
.BSLS_IDENT_PRAGMA_ONCE
This macro encapsulates the _Pragma("once")
functionality if available on the current platform. If available, this functions in the same way as redundant include guards, avoiding re-opening already-included header files.bsls_ident.h
and use the BSLS_IDENT macro. For header files this should be done directly after the include guards, e.g., bsls_somefile.h: // bsls_somefile.h -*-C++-*- #ifndef INCLUDED_BSLS_SOMEFILE #define INCLUDED_BSLS_SOMEFILE #include <bsls_ident.h> BSLS_IDENT("(DOLLAR)Id: (DOLLAR)") // In real usage, replace '(DOLLAR)' // with '$' // ... #endif // INCLUDED_BSLS_SOMEFILE
// bsls_ident.t.cpp -*-C++-*- #include <bsls_ident.h> BSLS_IDENT("(DOLLAR)Id: (DOLLAR)") // In real usage, replace '(DOLLAR)' // with '$'