- Timestamp:
- Apr 5, 2019, 9:26:53 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_arm/trunk/asp3_dcre/mbed/platform/mbed_preprocessor.h
r352 r374 1 1 /** \addtogroup platform */ 2 2 /** @{*/ 3 /** 4 * \defgroup platform_preprocessor preprocessor macros 5 * @{ 6 */ 7 3 8 /* mbed Microcontroller Library 4 9 * Copyright (c) 2006-2013 ARM Limited … … 48 53 #define MBED_STRINGIFY_(a) #a 49 54 55 /** MBED_STRLEN 56 * Reports string token length 57 * 58 * @note 59 * Expands tokens before calculating length 60 * 61 * @code 62 * // Get string length 63 * const int len = MBED_STRLEN("Get the length") 64 * @endcode 65 */ 66 #define MBED_STRLEN(a) MBED_STRLEN_(a) 67 #define MBED_STRLEN_(a) (sizeof(a) - 1) 68 69 /** MBED_COUNT_VA_ARGS(...) 70 * Reports number of tokens passed 71 * 72 * @note 73 * Token limit is 16 74 * 75 * @code 76 * // Get number of arguments 77 * const int count = MBED_COUNT_VA_ARGS("Address 0x%x, Data[0] = %d Data[1] = %d", 0x20001234, 10, 20) 78 * @endcode 79 */ 80 #define MBED_COUNT_VA_ARGS(...) GET_NTH_ARG_(__VA_ARGS__, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) 81 #define GET_NTH_ARG_(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, N, ...) N 50 82 51 83 #endif 52 84 53 85 /** @}*/ 86 /** @}*/
Note:
See TracChangeset
for help on using the changeset viewer.