summaryrefslogtreecommitdiffstats
path: root/libs/hwui/utils
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-02-20 10:57:22 -0800
committerJohn Reck <jreck@google.com>2015-02-20 10:58:48 -0800
commitc87be99c6ead0720a8918ea38ce3b25e5c49e1c6 (patch)
tree017c6aa6e000f52b0b579444e32336999912b656 /libs/hwui/utils
parentdf570c6e66d98536597737f863430510b6336ffe (diff)
downloadframeworks_base-c87be99c6ead0720a8918ea38ce3b25e5c49e1c6.zip
frameworks_base-c87be99c6ead0720a8918ea38ce3b25e5c49e1c6.tar.gz
frameworks_base-c87be99c6ead0720a8918ea38ce3b25e5c49e1c6.tar.bz2
C++11 style fixups
Change-Id: I356d02338820bfef41a9e278c88dafc17cfe1cf9
Diffstat (limited to 'libs/hwui/utils')
-rw-r--r--libs/hwui/utils/Macros.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/hwui/utils/Macros.h b/libs/hwui/utils/Macros.h
index b93f720..49d364e7 100644
--- a/libs/hwui/utils/Macros.h
+++ b/libs/hwui/utils/Macros.h
@@ -35,12 +35,12 @@
static_assert(std::is_standard_layout<Type>::value, \
#Type " must have standard layout")
-#define HWUI_ENUM(name, ...) \
- namespace name { \
- enum _##name { \
- __VA_ARGS__ \
- }; \
- } \
- typedef enum name::_##name name##Enum
+#define MAKE_FLAGS_ENUM(enumType) \
+ inline int operator|(enumType lhs, enumType rhs) { \
+ return static_cast<int>(lhs) | static_cast<int>(rhs); \
+ } \
+ inline int operator&(int lhs, enumType rhs) { \
+ return lhs & static_cast<int>(rhs); \
+ }
#endif /* MACROS_H */