diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-07-14 00:11:51 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-07-14 00:11:51 +0000 |
commit | 01d269879f127dff8db5367f3c341d983db3ab40 (patch) | |
tree | a75dce9069c04d88222df2ec82ee04348e3849b2 | |
parent | d9643cf6ece3b36fbdb950c56957162dfb0226af (diff) | |
download | lufa-01d269879f127dff8db5367f3c341d983db3ab40.tar.gz lufa-01d269879f127dff8db5367f3c341d983db3ab40.tar.bz2 lufa-01d269879f127dff8db5367f3c341d983db3ab40.zip |
Add new STRINGIFY() and STRINGIFY_EXPANDED() convenience macros.
-rw-r--r-- | LUFA/Common/Common.h | 20 | ||||
-rw-r--r-- | LUFA/ManPages/ChangeLog.txt | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index d46f92153..162d8516c 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 diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index 2a283380f..3b01ffeb7 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -27,6 +27,7 @@ * - Added new USB_Host_ConfigurationNumber global variable to indicate the selected configuration in an attached device * - Added new USB_Host_GetDeviceStatus() function to the host standard request function set * - Added AVR USB XMEGA architecture port (currently incomplete/experimental) + * - Added new STRINGIFY() and STRINGIFY_EXPANDED() convenience macros * - Library Applications: * - Added RNDIS device mode to the Webserver project * - Added new incomplete AndroidAccessoryHost Host LowLevel demo |