1 |
589 |
jeremybenn |
/*This file is prepared for Doxygen automatic documentation generation.*/
|
2 |
|
|
/*! \file *********************************************************************
|
3 |
|
|
*
|
4 |
|
|
* \brief Preprocessor token pasting utils.
|
5 |
|
|
*
|
6 |
|
|
* - Compiler: IAR EWAVR32 and GNU GCC for AVR32
|
7 |
|
|
* - Supported devices: All AVR32 devices can be used.
|
8 |
|
|
*
|
9 |
|
|
* \author Atmel Corporation: http://www.atmel.com \n
|
10 |
|
|
* Support and FAQ: http://support.atmel.no/
|
11 |
|
|
*
|
12 |
|
|
******************************************************************************/
|
13 |
|
|
|
14 |
|
|
/* Copyright (c) 2007, 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,
|
20 |
|
|
* this 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 |
|
|
* THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
30 |
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
31 |
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND
|
32 |
|
|
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
|
33 |
|
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
34 |
|
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
35 |
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
36 |
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
37 |
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
38 |
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
39 |
|
|
*/
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
#ifndef _TPASTE_H_
|
43 |
|
|
#define _TPASTE_H_
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
/*! \name Token Paste
|
47 |
|
|
*
|
48 |
|
|
* Paste N preprocessing tokens together, these tokens being allowed to be \#defined.
|
49 |
|
|
*
|
50 |
|
|
* May be used only within macros with the tokens passed as arguments if the tokens are \#defined.
|
51 |
|
|
*
|
52 |
|
|
* For example, writing TPASTE2(U, WIDTH) within a macro \#defined by
|
53 |
|
|
* UTYPE(WIDTH) and invoked as UTYPE(UL_WIDTH) with UL_WIDTH \#defined as 32 is
|
54 |
|
|
* equivalent to writing U32.
|
55 |
|
|
*/
|
56 |
|
|
//! @{
|
57 |
|
|
#define TPASTE2( a, b) a##b
|
58 |
|
|
#define TPASTE3( a, b, c) a##b##c
|
59 |
|
|
#define TPASTE4( a, b, c, d) a##b##c##d
|
60 |
|
|
#define TPASTE5( a, b, c, d, e) a##b##c##d##e
|
61 |
|
|
#define TPASTE6( a, b, c, d, e, f) a##b##c##d##e##f
|
62 |
|
|
#define TPASTE7( a, b, c, d, e, f, g) a##b##c##d##e##f##g
|
63 |
|
|
#define TPASTE8( a, b, c, d, e, f, g, h) a##b##c##d##e##f##g##h
|
64 |
|
|
#define TPASTE9( a, b, c, d, e, f, g, h, i) a##b##c##d##e##f##g##h##i
|
65 |
|
|
#define TPASTE10(a, b, c, d, e, f, g, h, i, j) a##b##c##d##e##f##g##h##i##j
|
66 |
|
|
//! @}
|
67 |
|
|
|
68 |
|
|
/*! \name Absolute Token Paste
|
69 |
|
|
*
|
70 |
|
|
* Paste N preprocessing tokens together, these tokens being allowed to be \#defined.
|
71 |
|
|
*
|
72 |
|
|
* No restriction of use if the tokens are \#defined.
|
73 |
|
|
*
|
74 |
|
|
* For example, writing ATPASTE2(U, UL_WIDTH) anywhere with UL_WIDTH \#defined
|
75 |
|
|
* as 32 is equivalent to writing U32.
|
76 |
|
|
*/
|
77 |
|
|
//! @{
|
78 |
|
|
#define ATPASTE2( a, b) TPASTE2( a, b)
|
79 |
|
|
#define ATPASTE3( a, b, c) TPASTE3( a, b, c)
|
80 |
|
|
#define ATPASTE4( a, b, c, d) TPASTE4( a, b, c, d)
|
81 |
|
|
#define ATPASTE5( a, b, c, d, e) TPASTE5( a, b, c, d, e)
|
82 |
|
|
#define ATPASTE6( a, b, c, d, e, f) TPASTE6( a, b, c, d, e, f)
|
83 |
|
|
#define ATPASTE7( a, b, c, d, e, f, g) TPASTE7( a, b, c, d, e, f, g)
|
84 |
|
|
#define ATPASTE8( a, b, c, d, e, f, g, h) TPASTE8( a, b, c, d, e, f, g, h)
|
85 |
|
|
#define ATPASTE9( a, b, c, d, e, f, g, h, i) TPASTE9( a, b, c, d, e, f, g, h, i)
|
86 |
|
|
#define ATPASTE10(a, b, c, d, e, f, g, h, i, j) TPASTE10(a, b, c, d, e, f, g, h, i, j)
|
87 |
|
|
//! @}
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
#endif // _TPASTE_H_
|