brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | #ifndef _AOS_COMMON_MACROS_H_ |
| 2 | #define _AOS_COMMON_MACROS_H_ |
| 3 | |
| 4 | // This file has some common macros etc. |
| 5 | |
| 6 | // A macro to disallow the copy constructor and operator= functions |
| 7 | // This should be used in the private: declarations for a class |
| 8 | #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ |
Brian Silverman | 08661c7 | 2013-09-01 17:24:38 -0700 | [diff] [blame^] | 9 | TypeName(const TypeName&) = delete; \ |
| 10 | void operator=(const TypeName&) = delete |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 11 | // A macro to wrap arguments to macros that contain commas. |
| 12 | // Useful for DISALLOW_COPY_AND_ASSIGNing templated types with multiple template |
| 13 | // arguments. |
| 14 | #define MACRO_ARG(...) __VA_ARGS__ |
| 15 | // Double-wraps macro arguments. |
| 16 | // Necessary to use commas in gtest predicate arguments. |
| 17 | #define MACRO_DARG(...) (__VA_ARGS__) |
| 18 | |
| 19 | #ifdef __GNUC__ |
| 20 | #define UNUSED_VARIABLE __attribute__ ((unused)) |
| 21 | #else |
| 22 | #define UNUSED_VARIABLE |
| 23 | #endif |
| 24 | |
| 25 | #endif // _AOS_COMMON_MACROS_H_ |