Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1217)

Unified Diff: mojo/public/system/macros.h

Issue 23913008: C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows build error. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/system/core.h ('k') | mojo/shell/app_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c4113035cfa29f27b5303dad6a2579fe8185696d
--- /dev/null
+++ b/mojo/public/system/macros.h
@@ -0,0 +1,39 @@
+// 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
+
+// A macro to disallow the copy constructor and operator= functions
+// This should be used in the private: declarations for a class
+#define MOJO_DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ void operator=(const TypeName&)
+
+// 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_
« no previous file with comments | « mojo/public/system/core.h ('k') | mojo/shell/app_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698