stringz.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*****************************************************************************
  2. *
  3. * \file
  4. *
  5. * \brief Preprocessor stringizing utils.
  6. *
  7. * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
  8. *
  9. * \asf_license_start
  10. *
  11. * \page License
  12. *
  13. * Subject to your compliance with these terms, you may use Microchip
  14. * software and any derivatives exclusively with Microchip products.
  15. * It is your responsibility to comply with third party license terms applicable
  16. * to your use of third party software (including open source software) that
  17. * may accompany Microchip software.
  18. *
  19. * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
  20. * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
  21. * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
  22. * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
  23. * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
  24. * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
  25. * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
  26. * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
  27. * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
  28. * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
  29. * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
  30. *
  31. * \asf_license_stop
  32. *
  33. ******************************************************************************/
  34. /*
  35. * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
  36. */
  37. #ifndef _STRINGZ_H_
  38. #define _STRINGZ_H_
  39. /**
  40. * \defgroup group_avr32_utils_stringz Preprocessor - Stringize
  41. *
  42. * \ingroup group_avr32_utils
  43. *
  44. * \{
  45. */
  46. /*! \brief Stringize.
  47. *
  48. * Stringize a preprocessing token, this token being allowed to be \#defined.
  49. *
  50. * May be used only within macros with the token passed as an argument if the token is \#defined.
  51. *
  52. * For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN)
  53. * and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to
  54. * writing "A0".
  55. */
  56. #define STRINGZ(x) #x
  57. /*! \brief Absolute stringize.
  58. *
  59. * Stringize a preprocessing token, this token being allowed to be \#defined.
  60. *
  61. * No restriction of use if the token is \#defined.
  62. *
  63. * For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is
  64. * equivalent to writing "A0".
  65. */
  66. #define ASTRINGZ(x) STRINGZ(x)
  67. /**
  68. * \}
  69. */
  70. #endif // _STRINGZ_H_