Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_PUBLIC_SYSTEM_MACROS_H_ | |
| 6 #define MOJO_PUBLIC_SYSTEM_MACROS_H_ | |
| 7 | |
| 8 #ifdef __cplusplus | |
| 9 | |
| 10 namespace mojo { | |
| 11 | |
| 12 // Annotate a virtual method indicating it must be overriding a virtual | |
| 13 // method in the parent class. | |
| 14 // Use like: | |
| 15 // virtual void foo() OVERRIDE; | |
| 16 #if defined(_MSC_VER) | |
| 17 #define MOJO_OVERRIDE override | |
| 18 #elif defined(__clang__) | |
|
dmichael (off chromium)
2013/10/14 22:41:19
nit: Could just use:
#if defined(_MSV_VER) || defi
| |
| 19 #define MOJO_OVERRIDE override | |
| 20 #else | |
| 21 #define MOJO_OVERRIDE | |
| 22 #endif | |
| 23 | |
| 24 // A macro to disallow the copy constructor and operator= functions | |
| 25 // This should be used in the private: declarations for a class | |
| 26 #define MOJO_DISALLOW_COPY_AND_ASSIGN(TypeName) \ | |
| 27 TypeName(const TypeName&); \ | |
| 28 void operator=(const TypeName&) | |
| 29 | |
| 30 // Used to assert things at compile time. | |
| 31 namespace internal { template <bool> struct CompileAssert {}; } | |
| 32 #define MOJO_COMPILE_ASSERT(expr, msg) \ | |
| 33 typedef internal::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] | |
|
dmichael (off chromium)
2013/10/14 22:41:19
nit: This is kind of a weird mix of static assert
| |
| 34 | |
| 35 } // namespace mojo | |
| 36 | |
| 37 #endif // __cplusplus | |
| 38 | |
| 39 #endif // MOJO_PUBLIC_SYSTEM_MACROS_H_ | |
| OLD | NEW |