| Index: mojo/public/system/macros.h
|
| diff --git a/mojo/public/system/macros.h b/mojo/public/system/macros.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6fad8f6b18b70cbdf1623105012826eebf531e72
|
| --- /dev/null
|
| +++ b/mojo/public/system/macros.h
|
| @@ -0,0 +1,33 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef MOJO_PUBLIC_SYSTEM_MACROS_H_
|
| +#define MOJO_PUBLIC_SYSTEM_MACROS_H_
|
| +
|
| +#ifdef __cplusplus
|
| +
|
| +namespace mojo {
|
| +
|
| +// Annotate a virtual method indicating it must be overriding a virtual
|
| +// method in the parent class.
|
| +// Use like:
|
| +// virtual void foo() OVERRIDE;
|
| +#if defined(_MSC_VER)
|
| +#define MOJO_OVERRIDE override
|
| +#elif defined(__clang__)
|
| +#define MOJO_OVERRIDE override
|
| +#else
|
| +#define MOJO_OVERRIDE
|
| +#endif
|
| +
|
| +// Used to assert things at compile time.
|
| +namespace internal { template <bool> struct CompileAssert {}; }
|
| +#define MOJO_COMPILE_ASSERT(expr, msg) \
|
| + typedef internal::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
|
| +
|
| +} // namespace mojo
|
| +
|
| +#endif // __cplusplus
|
| +
|
| +#endif // MOJO_PUBLIC_SYSTEM_MACROS_H_
|
|
|