1 | /** \addtogroup platform */
|
---|
2 | /** @{*/
|
---|
3 | /* mbed Microcontroller Library
|
---|
4 | * Copyright (c) 2006-2013 ARM Limited
|
---|
5 | *
|
---|
6 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
7 | * you may not use this file except in compliance with the License.
|
---|
8 | * You may obtain a copy of the License at
|
---|
9 | *
|
---|
10 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
11 | *
|
---|
12 | * Unless required by applicable law or agreed to in writing, software
|
---|
13 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
15 | * See the License for the specific language governing permissions and
|
---|
16 | * limitations under the License.
|
---|
17 | */
|
---|
18 | #ifndef MBED_PREPROCESSOR_H
|
---|
19 | #define MBED_PREPROCESSOR_H
|
---|
20 |
|
---|
21 |
|
---|
22 | /** MBED_CONCAT
|
---|
23 | * Concatenate tokens together
|
---|
24 | *
|
---|
25 | * @note
|
---|
26 | * Expands tokens before concatenation
|
---|
27 | *
|
---|
28 | * @code
|
---|
29 | * // Creates a unique label based on the line number
|
---|
30 | * int MBED_CONCAT(UNIQUE_LABEL_, __LINE__) = 1;
|
---|
31 | * @endcode
|
---|
32 | */
|
---|
33 | #define MBED_CONCAT(a, b) MBED_CONCAT_(a, b)
|
---|
34 | #define MBED_CONCAT_(a, b) a##b
|
---|
35 |
|
---|
36 | /** MBED_STRINGIFY
|
---|
37 | * Converts tokens into strings
|
---|
38 | *
|
---|
39 | * @note
|
---|
40 | * Expands tokens before stringification
|
---|
41 | *
|
---|
42 | * @code
|
---|
43 | * // Creates a string based on the parameters
|
---|
44 | * const char *c = MBED_STRINGIFY(This is a ridiculous way to create a string)
|
---|
45 | * @endcode
|
---|
46 | */
|
---|
47 | #define MBED_STRINGIFY(a) MBED_STRINGIFY_(a)
|
---|
48 | #define MBED_STRINGIFY_(a) #a
|
---|
49 |
|
---|
50 |
|
---|
51 | #endif
|
---|
52 |
|
---|
53 | /** @}*/
|
---|