diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-07-14 00:11:51 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-07-14 00:11:51 +0000 |
| commit | 70b8c155355004f90f478099bdd62133580bbf00 (patch) | |
| tree | a75dce9069c04d88222df2ec82ee04348e3849b2 /LUFA/Common/Common.h | |
| parent | b8263b3e2a3307fab559d17e211356d67ad77262 (diff) | |
Add new STRINGIFY() and STRINGIFY_EXPANDED() convenience macros.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1870 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Common/Common.h')
| -rw-r--r-- | LUFA/Common/Common.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index d46f9215..162d8516 100644 --- a/LUFA/Common/Common.h +++ b/LUFA/Common/Common.h @@ -181,6 +181,26 @@ #if !defined(MIN) || defined(__DOXYGEN__) #define MIN(x, y) ((x < y) ? x : y) #endif + + #if !defined(STRINGIFY) || defined(__DOXYGEN__) + /** Converts the given input into a string, via the C Preprocessor. This macro puts literal quotation + * marks around the input, converting the source into a string literal. + * + * \param[in] x Input to convert into a string literal. + * + * \return String version of the input. + */ + #define STRINGIFY(x) #x + + /** Converts the given input into a string after macro expansion, via the C Preprocessor. This macro puts + * literal quotation marks around the expanded input, converting the source into a string literal. + * + * \param[in] x Input to expand and convert into a string literal. + * + * \return String version of the expanded input. + */ + #define STRINGIFY_EXPANDED(x) STRINGIFY(x) + #endif #if (ARCH == ARCH_AVR8) || defined(__DOXYGEN__) /** Defines a volatile \c NOP statement which cannot be optimized out by the compiler, and thus can always |
