| 20 #include <type_traits> |
20 #include <type_traits> |
| 21 |
21 |
| 22 #ifndef __GNUC__ |
22 #ifndef __GNUC__ |
| 23 # define __attribute__(X) |
23 # define __attribute__(X) |
| 24 #endif |
24 #endif |
| 25 |
|
| 26 template <typename T, size_t N> |
|
| 27 char (&countofHelper (T(&)[N]))[N]; |
|
| 28 #define countof(x) ((int) sizeof (countofHelper(x))) |
|
| 29 |
25 |
| 30 #define DEFINE_CLASS(SELF, SUPER) \ |
26 #define DEFINE_CLASS(SELF, SUPER) \ |
| 31 public: \ |
27 public: \ |
| 32 using Self = SELF; \ |
28 using Self = SELF; \ |
| 33 using Super = SUPER; |
29 using Super = SUPER; |