OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_ | 5 #ifndef MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_ |
6 #define MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_ | 6 #define MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_ |
7 | 7 |
8 #include "mojo/public/c/system/macros.h" | 8 #include "mojo/public/c/system/macros.h" |
9 | 9 |
10 // Define a set of C++ specific macros. | 10 // Define a set of C++ specific macros. |
11 // Mojo C++ API users can assume that mojo/public/cpp/system/macros.h | 11 // Mojo C++ API users can assume that mojo/public/cpp/system/macros.h |
12 // includes mojo/public/c/system/macros.h. | 12 // includes mojo/public/c/system/macros.h. |
13 | 13 |
| 14 // TODO(vtl): Get rid of this once all users have been eliminated. |
14 // Annotate a virtual method indicating it must be overriding a virtual method | 15 // Annotate a virtual method indicating it must be overriding a virtual method |
15 // in the parent class. Use like: | 16 // in the parent class. Use like: |
16 // virtual void foo() OVERRIDE; | 17 // virtual void foo() OVERRIDE; |
17 #if defined(_MSC_VER) || defined(__clang__) | |
18 #define MOJO_OVERRIDE override | 18 #define MOJO_OVERRIDE override |
19 #else | |
20 #define MOJO_OVERRIDE | |
21 #endif | |
22 | 19 |
23 // A macro to disallow the copy constructor and operator= functions. | 20 // A macro to disallow the copy constructor and operator= functions. |
24 // This should be used in the private: declarations for a class. | 21 // This should be used in the private: declarations for a class. |
25 #define MOJO_DISALLOW_COPY_AND_ASSIGN(TypeName) \ | 22 #define MOJO_DISALLOW_COPY_AND_ASSIGN(TypeName) \ |
26 TypeName(const TypeName&); \ | 23 TypeName(const TypeName&); \ |
27 void operator=(const TypeName&) | 24 void operator=(const TypeName&) |
28 | 25 |
29 // Used to calculate the number of elements in an array. | 26 // Used to calculate the number of elements in an array. |
30 // (See |arraysize()| in Chromium's base/basictypes.h for more details.) | 27 // (See |arraysize()| in Chromium's base/basictypes.h for more details.) |
31 namespace mojo { | 28 namespace mojo { |
(...skipping 16 matching lines...) Expand all Loading... |
48 }; \ | 45 }; \ |
49 type(type&); \ | 46 type(type&); \ |
50 void operator=(type&); \ | 47 void operator=(type&); \ |
51 public: \ | 48 public: \ |
52 operator rvalue_type() { return rvalue_type(this); } \ | 49 operator rvalue_type() { return rvalue_type(this); } \ |
53 type Pass() { return type(rvalue_type(this)); } \ | 50 type Pass() { return type(rvalue_type(this)); } \ |
54 typedef void MoveOnlyTypeForCPP03; \ | 51 typedef void MoveOnlyTypeForCPP03; \ |
55 private: | 52 private: |
56 | 53 |
57 #endif // MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_ | 54 #endif // MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_ |
OLD | NEW |