blob: 2018b36bea91d0d0cd24e02e478c017e81d8fe7f [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#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 Silverman08661c72013-09-01 17:24:38 -07009 TypeName(const TypeName&) = delete; \
10 void operator=(const TypeName&) = delete
brians343bc112013-02-10 01:53:46 +000011// 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_