stringz.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */
  2. /*This file is prepared for Doxygen automatic documentation generation.*/
  3. /*! \file *********************************************************************
  4. *
  5. * \brief Preprocessor stringizing utils.
  6. *
  7. * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
  8. * - Supported devices: All AVR32 devices can be used.
  9. *
  10. * \author Atmel Corporation: http://www.atmel.com \n
  11. * Support and FAQ: http://support.atmel.no/
  12. *
  13. ******************************************************************************/
  14. /* Copyright (c) 2009 Atmel Corporation. All rights reserved.
  15. *
  16. * Redistribution and use in source and binary forms, with or without
  17. * modification, are permitted provided that the following conditions are met:
  18. *
  19. * 1. Redistributions of source code must retain the above copyright notice, this
  20. * list of conditions and the following disclaimer.
  21. *
  22. * 2. Redistributions in binary form must reproduce the above copyright notice,
  23. * this list of conditions and the following disclaimer in the documentation
  24. * and/or other materials provided with the distribution.
  25. *
  26. * 3. The name of Atmel may not be used to endorse or promote products derived
  27. * from this software without specific prior written permission.
  28. *
  29. * 4. This software may only be redistributed and used in connection with an Atmel
  30. * AVR product.
  31. *
  32. * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
  33. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  34. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
  35. * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
  36. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  37. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  38. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  39. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  40. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  41. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
  42. *
  43. */
  44. #ifndef _STRINGZ_H_
  45. #define _STRINGZ_H_
  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. #endif // _STRINGZ_H_