From ecd73b09cccaaab72c859fef403ed489b7d1f174 Mon Sep 17 00:00:00 2001
From: amistry <amistry@chromium.org>
Date: Thu, 10 Mar 2016 22:32:52 -0800
Subject: [mojo-sdk] Remove mojo_ignore_result and move C++ macros.h to
 bindings internal code.

The one macro remaining in macros.h is only used by generated C++ code.

BUG=534695

Review URL: https://codereview.chromium.org/1784743003

Cr-Commit-Position: refs/heads/master@{#380556}
---
 components/mus/common/window_tracker.h             |  2 +-
 .../public/cpp/tests/window_server_test_suite.h    |  1 -
 components/mus/public/cpp/window.h                 |  1 -
 components/mus/public/cpp/window_tracker.h         |  1 -
 .../resource_provider/resource_provider_apptest.cc |  1 -
 mojo/edk/embedder/embedder_unittest.cc             |  1 -
 mojo/edk/embedder/platform_channel_pair.h          |  1 -
 .../platform_channel_pair_posix_unittest.cc        |  1 -
 mojo/edk/embedder/platform_shared_buffer.h         |  1 -
 .../embedder/platform_shared_buffer_unittest.cc    |  1 -
 mojo/edk/js/tests/js_to_cpp_tests.cc               |  1 -
 mojo/edk/system/core_test_base.cc                  |  1 -
 mojo/edk/system/core_test_base.h                   |  1 -
 mojo/edk/system/core_unittest.cc                   |  1 -
 mojo/edk/system/data_pipe.h                        |  1 -
 mojo/edk/system/data_pipe_unittest.cc              |  1 -
 mojo/edk/system/mapping_table.h                    |  2 +-
 mojo/edk/system/options_validation.h               |  1 -
 .../system/shared_buffer_dispatcher_unittest.cc    |  2 +-
 mojo/edk/system/test_utils.h                       |  1 -
 mojo/edk/system/wait_set_dispatcher_unittest.cc    |  1 -
 mojo/edk/system/waiter_test_utils.h                |  2 +-
 mojo/edk/system/waiter_unittest.cc                 |  2 +-
 mojo/edk/test/scoped_ipc_support.h                 |  1 -
 mojo/mojo_edk_tests.gyp                            |  1 +
 mojo/mojo_public.gyp                               |  2 +-
 mojo/mojo_variables.gypi                           |  1 -
 mojo/public/c/system/macros.h                      | 14 -----
 mojo/public/c/system/tests/core_perftest.cc        |  2 +-
 mojo/public/cpp/bindings/BUILD.gn                  |  1 +
 mojo/public/cpp/bindings/interface_ptr_info.h      |  2 +-
 mojo/public/cpp/bindings/lib/connector.cc          |  2 +-
 .../cpp/bindings/lib/control_message_handler.h     |  2 +-
 .../cpp/bindings/lib/control_message_proxy.cc      |  2 +-
 .../cpp/bindings/lib/control_message_proxy.h       |  2 +-
 mojo/public/cpp/bindings/lib/filter_chain.h        |  2 +-
 mojo/public/cpp/bindings/lib/macros.h              | 33 +++++++++++
 mojo/public/cpp/bindings/lib/shared_data.h         |  1 -
 mojo/public/cpp/bindings/lib/validate_params.h     |  2 +-
 mojo/public/cpp/bindings/lib/validation_errors.h   |  2 +-
 mojo/public/cpp/bindings/message_filter.h          |  1 -
 mojo/public/cpp/bindings/struct_ptr.h              |  2 +-
 mojo/public/cpp/bindings/tests/BUILD.gn            |  1 +
 mojo/public/cpp/bindings/tests/binding_unittest.cc |  2 +-
 .../cpp/bindings/tests/connector_unittest.cc       |  1 -
 .../cpp/bindings/tests/container_test_util.h       |  1 -
 mojo/public/cpp/bindings/tests/macros_unittest.cc  | 66 ++++++++++++++++++++++
 mojo/public/cpp/bindings/tests/router_unittest.cc  |  1 -
 .../cpp/bindings/tests/validation_unittest.cc      |  2 +-
 .../cpp/bindings/tests/versioning_apptest.cc       |  2 +-
 .../cpp/bindings/tests/versioning_test_service.cc  |  2 +-
 mojo/public/cpp/system/BUILD.gn                    |  1 -
 mojo/public/cpp/system/buffer.h                    |  1 -
 mojo/public/cpp/system/core.h                      |  1 -
 mojo/public/cpp/system/data_pipe.h                 |  1 -
 mojo/public/cpp/system/handle.h                    |  1 -
 mojo/public/cpp/system/macros.h                    | 39 -------------
 mojo/public/cpp/system/message_pipe.h              |  1 -
 mojo/public/cpp/system/tests/BUILD.gn              |  1 -
 mojo/public/cpp/system/tests/core_unittest.cc      |  1 -
 mojo/public/cpp/system/tests/macros_unittest.cc    | 66 ----------------------
 .../generators/cpp_templates/module.cc.tmpl        |  1 +
 mojo/shell/public/cpp/application_test_base.h      |  2 +-
 mojo/shell/public/cpp/shell_client.h               |  2 +-
 mojo/shell/public/cpp/shell_test.h                 |  2 +-
 65 files changed, 126 insertions(+), 175 deletions(-)
 create mode 100644 mojo/public/cpp/bindings/lib/macros.h
 create mode 100644 mojo/public/cpp/bindings/tests/macros_unittest.cc
 delete mode 100644 mojo/public/cpp/system/macros.h
 delete mode 100644 mojo/public/cpp/system/tests/macros_unittest.cc

diff --git a/components/mus/common/window_tracker.h b/components/mus/common/window_tracker.h
index 8446bbf..7113f3d 100644
--- a/components/mus/common/window_tracker.h
+++ b/components/mus/common/window_tracker.h
@@ -7,8 +7,8 @@
 
 #include <vector>
 
+#include "base/macros.h"
 #include "base/stl_util.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mus {
 
diff --git a/components/mus/public/cpp/tests/window_server_test_suite.h b/components/mus/public/cpp/tests/window_server_test_suite.h
index 43565bb..45104b7 100644
--- a/components/mus/public/cpp/tests/window_server_test_suite.h
+++ b/components/mus/public/cpp/tests/window_server_test_suite.h
@@ -7,7 +7,6 @@
 
 #include "base/macros.h"
 #include "base/test/test_suite.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mus {
 
diff --git a/components/mus/public/cpp/window.h b/components/mus/public/cpp/window.h
index e3bda59..3c3e460 100644
--- a/components/mus/public/cpp/window.h
+++ b/components/mus/public/cpp/window.h
@@ -16,7 +16,6 @@
 #include "components/mus/public/interfaces/surface_id.mojom.h"
 #include "components/mus/public/interfaces/window_tree.mojom.h"
 #include "mojo/public/cpp/bindings/array.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "mojo/shell/public/interfaces/interface_provider.mojom.h"
 #include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/geometry/rect.h"
diff --git a/components/mus/public/cpp/window_tracker.h b/components/mus/public/cpp/window_tracker.h
index 38ea000..9cbafeb 100644
--- a/components/mus/public/cpp/window_tracker.h
+++ b/components/mus/public/cpp/window_tracker.h
@@ -11,7 +11,6 @@
 #include "base/macros.h"
 #include "components/mus/common/window_tracker.h"
 #include "components/mus/public/cpp/window_observer.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mus {
 
diff --git a/components/resource_provider/resource_provider_apptest.cc b/components/resource_provider/resource_provider_apptest.cc
index 1632a2a..a4c84ad 100644
--- a/components/resource_provider/resource_provider_apptest.cc
+++ b/components/resource_provider/resource_provider_apptest.cc
@@ -14,7 +14,6 @@
 #include "mojo/common/common_type_converters.h"
 #include "mojo/platform_handle/platform_handle_functions.h"
 #include "mojo/public/cpp/bindings/array.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "mojo/shell/public/cpp/application_test_base.h"
 
 namespace resource_provider {
diff --git a/mojo/edk/embedder/embedder_unittest.cc b/mojo/edk/embedder/embedder_unittest.cc
index 9b96c1f..b5927b3 100644
--- a/mojo/edk/embedder/embedder_unittest.cc
+++ b/mojo/edk/embedder/embedder_unittest.cc
@@ -24,7 +24,6 @@
 #include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/c/system/core.h"
 #include "mojo/public/cpp/system/handle.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "mojo/public/cpp/system/message_pipe.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/mojo/edk/embedder/platform_channel_pair.h b/mojo/edk/embedder/platform_channel_pair.h
index 596ed2e..591592b 100644
--- a/mojo/edk/embedder/platform_channel_pair.h
+++ b/mojo/edk/embedder/platform_channel_pair.h
@@ -11,7 +11,6 @@
 #include "build/build_config.h"
 #include "mojo/edk/embedder/scoped_platform_handle.h"
 #include "mojo/edk/system/system_impl_export.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace base {
 class CommandLine;
diff --git a/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc b/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
index 45a6dce..e05cd79 100644
--- a/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
+++ b/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
@@ -27,7 +27,6 @@
 #include "mojo/edk/embedder/platform_handle_vector.h"
 #include "mojo/edk/embedder/scoped_platform_handle.h"
 #include "mojo/edk/test/test_utils.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/edk/embedder/platform_shared_buffer.h b/mojo/edk/embedder/platform_shared_buffer.h
index 7ca596a..dfe91651 100644
--- a/mojo/edk/embedder/platform_shared_buffer.h
+++ b/mojo/edk/embedder/platform_shared_buffer.h
@@ -15,7 +15,6 @@
 #include "base/synchronization/lock.h"
 #include "mojo/edk/embedder/scoped_platform_handle.h"
 #include "mojo/edk/system/system_impl_export.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace edk {
diff --git a/mojo/edk/embedder/platform_shared_buffer_unittest.cc b/mojo/edk/embedder/platform_shared_buffer_unittest.cc
index 5c12f85..098ff26 100644
--- a/mojo/edk/embedder/platform_shared_buffer_unittest.cc
+++ b/mojo/edk/embedder/platform_shared_buffer_unittest.cc
@@ -12,7 +12,6 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/shared_memory.h"
 #include "base/sys_info.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 #if defined(OS_WIN)
diff --git a/mojo/edk/js/tests/js_to_cpp_tests.cc b/mojo/edk/js/tests/js_to_cpp_tests.cc
index 08f3a0c..6d3426d 100644
--- a/mojo/edk/js/tests/js_to_cpp_tests.cc
+++ b/mojo/edk/js/tests/js_to_cpp_tests.cc
@@ -24,7 +24,6 @@
 #include "mojo/edk/test/test_utils.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "mojo/public/cpp/system/core.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/edk/system/core_test_base.cc b/mojo/edk/system/core_test_base.cc
index dd1473a..635501a 100644
--- a/mojo/edk/system/core_test_base.cc
+++ b/mojo/edk/system/core_test_base.cc
@@ -16,7 +16,6 @@
 #include "mojo/edk/system/configuration.h"
 #include "mojo/edk/system/core.h"
 #include "mojo/edk/system/dispatcher.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace edk {
diff --git a/mojo/edk/system/core_test_base.h b/mojo/edk/system/core_test_base.h
index 665b9a0..3d2346a 100644
--- a/mojo/edk/system/core_test_base.h
+++ b/mojo/edk/system/core_test_base.h
@@ -12,7 +12,6 @@
 #include "mojo/edk/embedder/embedder_internal.h"
 #include "mojo/edk/system/test_utils.h"
 #include "mojo/public/c/system/types.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/edk/system/core_unittest.cc b/mojo/edk/system/core_unittest.cc
index a339767..7eeabc0 100644
--- a/mojo/edk/system/core_unittest.cc
+++ b/mojo/edk/system/core_unittest.cc
@@ -13,7 +13,6 @@
 #include "mojo/edk/system/awakable.h"
 #include "mojo/edk/system/core_test_base.h"
 #include "mojo/edk/system/test_utils.h"
-#include "mojo/public/cpp/system/macros.h"
 
 #if defined(OS_WIN)
 #include "base/win/windows_version.h"
diff --git a/mojo/edk/system/data_pipe.h b/mojo/edk/system/data_pipe.h
index d2b90bf..2428189 100644
--- a/mojo/edk/system/data_pipe.h
+++ b/mojo/edk/system/data_pipe.h
@@ -13,7 +13,6 @@
 #include "mojo/edk/system/system_impl_export.h"
 #include "mojo/public/c/system/data_pipe.h"
 #include "mojo/public/c/system/types.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace edk {
diff --git a/mojo/edk/system/data_pipe_unittest.cc b/mojo/edk/system/data_pipe_unittest.cc
index a343282..944340b 100644
--- a/mojo/edk/system/data_pipe_unittest.cc
+++ b/mojo/edk/system/data_pipe_unittest.cc
@@ -19,7 +19,6 @@
 #include "mojo/public/c/system/data_pipe.h"
 #include "mojo/public/c/system/functions.h"
 #include "mojo/public/c/system/message_pipe.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/edk/system/mapping_table.h b/mojo/edk/system/mapping_table.h
index ed0a0f6..120f9ca 100644
--- a/mojo/edk/system/mapping_table.h
+++ b/mojo/edk/system/mapping_table.h
@@ -10,10 +10,10 @@
 #include <vector>
 
 #include "base/containers/hash_tables.h"
+#include "base/macros.h"
 #include "base/memory/scoped_ptr.h"
 #include "mojo/edk/system/system_impl_export.h"
 #include "mojo/public/c/system/types.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 
diff --git a/mojo/edk/system/options_validation.h b/mojo/edk/system/options_validation.h
index ac81954..e1b337d 100644
--- a/mojo/edk/system/options_validation.h
+++ b/mojo/edk/system/options_validation.h
@@ -20,7 +20,6 @@
 #include "base/macros.h"
 #include "mojo/edk/system/system_impl_export.h"
 #include "mojo/public/c/system/types.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace edk {
diff --git a/mojo/edk/system/shared_buffer_dispatcher_unittest.cc b/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
index 902f786..5605264 100644
--- a/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
+++ b/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
@@ -9,10 +9,10 @@
 
 #include <limits>
 
+#include "base/macros.h"
 #include "base/memory/ref_counted.h"
 #include "mojo/edk/embedder/platform_shared_buffer.h"
 #include "mojo/edk/system/dispatcher.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/edk/system/test_utils.h b/mojo/edk/system/test_utils.h
index b576f81..1c90dc1 100644
--- a/mojo/edk/system/test_utils.h
+++ b/mojo/edk/system/test_utils.h
@@ -8,7 +8,6 @@
 #include "base/macros.h"
 #include "base/time/time.h"
 #include "mojo/public/c/system/types.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/edk/system/wait_set_dispatcher_unittest.cc b/mojo/edk/system/wait_set_dispatcher_unittest.cc
index 1034705..a90a356 100644
--- a/mojo/edk/system/wait_set_dispatcher_unittest.cc
+++ b/mojo/edk/system/wait_set_dispatcher_unittest.cc
@@ -16,7 +16,6 @@
 #include "mojo/edk/system/message_pipe_dispatcher.h"
 #include "mojo/edk/system/test_utils.h"
 #include "mojo/edk/system/waiter.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/edk/system/waiter_test_utils.h b/mojo/edk/system/waiter_test_utils.h
index 016b295..eda1396 100644
--- a/mojo/edk/system/waiter_test_utils.h
+++ b/mojo/edk/system/waiter_test_utils.h
@@ -7,13 +7,13 @@
 
 #include <stdint.h>
 
+#include "base/macros.h"
 #include "base/memory/ref_counted.h"
 #include "base/threading/simple_thread.h"
 #include "mojo/edk/system/dispatcher.h"
 #include "mojo/edk/system/handle_signals_state.h"
 #include "mojo/edk/system/waiter.h"
 #include "mojo/public/c/system/types.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace edk {
diff --git a/mojo/edk/system/waiter_unittest.cc b/mojo/edk/system/waiter_unittest.cc
index 16250cc..aa928ffe 100644
--- a/mojo/edk/system/waiter_unittest.cc
+++ b/mojo/edk/system/waiter_unittest.cc
@@ -11,10 +11,10 @@
 
 #include <stdint.h>
 
+#include "base/macros.h"
 #include "base/synchronization/lock.h"
 #include "base/threading/simple_thread.h"
 #include "mojo/edk/system/test_utils.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/edk/test/scoped_ipc_support.h b/mojo/edk/test/scoped_ipc_support.h
index ff2f558..04173d3 100644
--- a/mojo/edk/test/scoped_ipc_support.h
+++ b/mojo/edk/test/scoped_ipc_support.h
@@ -11,7 +11,6 @@
 #include "base/task_runner.h"
 #include "mojo/edk/embedder/process_delegate.h"
 #include "mojo/edk/embedder/scoped_platform_handle.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace edk {
diff --git a/mojo/mojo_edk_tests.gyp b/mojo/mojo_edk_tests.gyp
index b67857a..b8ff828 100644
--- a/mojo/mojo_edk_tests.gyp
+++ b/mojo/mojo_edk_tests.gyp
@@ -70,6 +70,7 @@
         'public/cpp/bindings/tests/equals_unittest.cc',
         'public/cpp/bindings/tests/handle_passing_unittest.cc',
         'public/cpp/bindings/tests/interface_ptr_unittest.cc',
+        'public/cpp/bindings/tests/macros_unittest.cc',
         'public/cpp/bindings/tests/map_unittest.cc',
         'public/cpp/bindings/tests/message_queue.cc',
         'public/cpp/bindings/tests/message_queue.h',
diff --git a/mojo/mojo_public.gyp b/mojo/mojo_public.gyp
index ca5ff13..2844195 100644
--- a/mojo/mojo_public.gyp
+++ b/mojo/mojo_public.gyp
@@ -81,7 +81,6 @@
         'public/cpp/system/data_pipe.h',
         'public/cpp/system/functions.h',
         'public/cpp/system/handle.h',
-        'public/cpp/system/macros.h',
         'public/cpp/system/message_pipe.h',
         'public/cpp/system/watcher.cc',
         'public/cpp/system/watcher.h',
@@ -139,6 +138,7 @@
         'public/cpp/bindings/lib/interface_endpoint_client.cc',
         'public/cpp/bindings/lib/interface_endpoint_client.h',
         'public/cpp/bindings/lib/interface_ptr_state.h',
+        'public/cpp/bindings/lib/macros.h',
         'public/cpp/bindings/lib/map_data_internal.h',
         'public/cpp/bindings/lib/map_internal.h',
         'public/cpp/bindings/lib/map_serialization.h',
diff --git a/mojo/mojo_variables.gypi b/mojo/mojo_variables.gypi
index 66ec138..e19aa95 100644
--- a/mojo/mojo_variables.gypi
+++ b/mojo/mojo_variables.gypi
@@ -44,7 +44,6 @@
       '<(DEPTH)/mojo/public/c/system/tests/core_unittest_pure_c.c',
       '<(DEPTH)/mojo/public/c/system/tests/macros_unittest.cc',
       '<(DEPTH)/mojo/public/cpp/system/tests/core_unittest.cc',
-      '<(DEPTH)/mojo/public/cpp/system/tests/macros_unittest.cc',
       '<(DEPTH)/mojo/public/cpp/system/tests/watcher_unittest.cc',
     ],
   },
diff --git a/mojo/public/c/system/macros.h b/mojo/public/c/system/macros.h
index ce84170..917c69c 100644
--- a/mojo/public/c/system/macros.h
+++ b/mojo/public/c/system/macros.h
@@ -7,20 +7,6 @@
 
 #include <stddef.h>
 
-#ifdef __cplusplus
-// Used to explicitly mark the return value of a function as unused. If you are
-// really sure you don't want to do anything with the return value of a function
-// that has been marked WARN_UNUSED_RESULT, wrap it with this. Example:
-//
-//   scoped_ptr<MyType> my_var = ...;
-//   if (TakeOwnership(my_var.get()) == SUCCESS)
-//     mojo_ignore_result(my_var.release());
-//
-template <typename T>
-inline void mojo_ignore_result(const T&) {
-}
-#endif
-
 // Assert things at compile time. (|msg| should be a valid identifier name.)
 // This macro is currently C++-only, but we want to use it in the C core.h.
 // Use like:
diff --git a/mojo/public/c/system/tests/core_perftest.cc b/mojo/public/c/system/tests/core_perftest.cc
index 80734d30..5d4e56b 100644
--- a/mojo/public/c/system/tests/core_perftest.cc
+++ b/mojo/public/c/system/tests/core_perftest.cc
@@ -10,8 +10,8 @@
 #include <stdint.h>
 #include <stdio.h>
 
+#include "base/macros.h"
 #include "base/threading/simple_thread.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "mojo/public/cpp/test_support/test_support.h"
 #include "mojo/public/cpp/test_support/test_utils.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/mojo/public/cpp/bindings/BUILD.gn b/mojo/public/cpp/bindings/BUILD.gn
index 137d8d3..0486a52 100644
--- a/mojo/public/cpp/bindings/BUILD.gn
+++ b/mojo/public/cpp/bindings/BUILD.gn
@@ -43,6 +43,7 @@ source_set("bindings") {
     "lib/interface_endpoint_client.h",
     "lib/interface_id.h",
     "lib/interface_ptr_state.h",
+    "lib/macros.h",
     "lib/map_data_internal.h",
     "lib/map_internal.h",
     "lib/map_serialization.h",
diff --git a/mojo/public/cpp/bindings/interface_ptr_info.h b/mojo/public/cpp/bindings/interface_ptr_info.h
index 4d559f5..014410d 100644
--- a/mojo/public/cpp/bindings/interface_ptr_info.h
+++ b/mojo/public/cpp/bindings/interface_ptr_info.h
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <utility>
 
-#include "mojo/public/cpp/system/macros.h"
+#include "base/move.h"
 #include "mojo/public/cpp/system/message_pipe.h"
 
 namespace mojo {
diff --git a/mojo/public/cpp/bindings/lib/connector.cc b/mojo/public/cpp/bindings/lib/connector.cc
index c7378f0..c84a93d 100644
--- a/mojo/public/cpp/bindings/lib/connector.cc
+++ b/mojo/public/cpp/bindings/lib/connector.cc
@@ -108,7 +108,7 @@ bool Connector::WaitForIncomingMessage(MojoDeadline deadline) {
     HandleError(rv != MOJO_RESULT_FAILED_PRECONDITION, false);
     return false;
   }
-  mojo_ignore_result(ReadSingleMessage(&rv));
+  ignore_result(ReadSingleMessage(&rv));
   return (rv == MOJO_RESULT_OK);
 }
 
diff --git a/mojo/public/cpp/bindings/lib/control_message_handler.h b/mojo/public/cpp/bindings/lib/control_message_handler.h
index 225dfec..27acde8c 100644
--- a/mojo/public/cpp/bindings/lib/control_message_handler.h
+++ b/mojo/public/cpp/bindings/lib/control_message_handler.h
@@ -7,8 +7,8 @@
 
 #include <stdint.h>
 
+#include "base/macros.h"
 #include "mojo/public/cpp/bindings/message.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace internal {
diff --git a/mojo/public/cpp/bindings/lib/control_message_proxy.cc b/mojo/public/cpp/bindings/lib/control_message_proxy.cc
index d450355..6208065 100644
--- a/mojo/public/cpp/bindings/lib/control_message_proxy.cc
+++ b/mojo/public/cpp/bindings/lib/control_message_proxy.cc
@@ -8,9 +8,9 @@
 #include <stdint.h>
 #include <utility>
 
+#include "base/macros.h"
 #include "mojo/public/cpp/bindings/lib/message_builder.h"
 #include "mojo/public/cpp/bindings/message.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
 
 namespace mojo {
diff --git a/mojo/public/cpp/bindings/lib/control_message_proxy.h b/mojo/public/cpp/bindings/lib/control_message_proxy.h
index 57b871e..33aaf82 100644
--- a/mojo/public/cpp/bindings/lib/control_message_proxy.h
+++ b/mojo/public/cpp/bindings/lib/control_message_proxy.h
@@ -7,8 +7,8 @@
 
 #include <stdint.h>
 
+#include "base/macros.h"
 #include "mojo/public/cpp/bindings/callback.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 
diff --git a/mojo/public/cpp/bindings/lib/filter_chain.h b/mojo/public/cpp/bindings/lib/filter_chain.h
index 99e8e73..689a7fa 100644
--- a/mojo/public/cpp/bindings/lib/filter_chain.h
+++ b/mojo/public/cpp/bindings/lib/filter_chain.h
@@ -7,9 +7,9 @@
 
 #include <vector>
 
+#include "base/move.h"
 #include "mojo/public/cpp/bindings/message.h"
 #include "mojo/public/cpp/bindings/message_filter.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace internal {
diff --git a/mojo/public/cpp/bindings/lib/macros.h b/mojo/public/cpp/bindings/lib/macros.h
new file mode 100644
index 0000000..62f4292
--- /dev/null
+++ b/mojo/public/cpp/bindings/lib/macros.h
@@ -0,0 +1,33 @@
+// Copyright 2014 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_CPP_BINDINGS_LIB_MACROS_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_LIB_MACROS_H_
+
+// This file defines macros that are only used by generated bindings.
+
+// The C++ standard requires that static const members have an out-of-class
+// definition (in a single compilation unit), but MSVC chokes on this (when
+// language extensions, which are required, are enabled). (You're only likely to
+// notice the need for a definition if you take the address of the member or,
+// more commonly, pass it to a function that takes it as a reference argument --
+// probably an STL function.) This macro makes MSVC do the right thing. See
+// http://msdn.microsoft.com/en-us/library/34h23df8(v=vs.100).aspx for more
+// information. This workaround does not appear to be necessary after VS2015.
+// Use like:
+//
+// In the .h file:
+//   struct Foo {
+//     static const int kBar = 5;
+//   };
+//
+// In the .cc file:
+//   MOJO_STATIC_CONST_MEMBER_DEFINITION const int Foo::kBar;
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#define MOJO_STATIC_CONST_MEMBER_DEFINITION __declspec(selectany)
+#else
+#define MOJO_STATIC_CONST_MEMBER_DEFINITION
+#endif
+
+#endif  // MOJO_PUBLIC_CPP_BINDINGS_LIB_MACROS_H_
diff --git a/mojo/public/cpp/bindings/lib/shared_data.h b/mojo/public/cpp/bindings/lib/shared_data.h
index 0afd892..8e93300 100644
--- a/mojo/public/cpp/bindings/lib/shared_data.h
+++ b/mojo/public/cpp/bindings/lib/shared_data.h
@@ -8,7 +8,6 @@
 #include "base/logging.h"
 #include "base/macros.h"
 #include "base/threading/thread_checker.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace internal {
diff --git a/mojo/public/cpp/bindings/lib/validate_params.h b/mojo/public/cpp/bindings/lib/validate_params.h
index 4f4735a..78c0589 100644
--- a/mojo/public/cpp/bindings/lib/validate_params.h
+++ b/mojo/public/cpp/bindings/lib/validate_params.h
@@ -7,7 +7,7 @@
 
 #include <stdint.h>
 
-#include "mojo/public/cpp/system/macros.h"
+#include "base/macros.h"
 
 namespace mojo {
 namespace internal {
diff --git a/mojo/public/cpp/bindings/lib/validation_errors.h b/mojo/public/cpp/bindings/lib/validation_errors.h
index 1fcd335..bdace6c 100644
--- a/mojo/public/cpp/bindings/lib/validation_errors.h
+++ b/mojo/public/cpp/bindings/lib/validation_errors.h
@@ -6,8 +6,8 @@
 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_
 
 #include "base/logging.h"
+#include "base/macros.h"
 #include "mojo/public/cpp/bindings/callback.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace internal {
diff --git a/mojo/public/cpp/bindings/message_filter.h b/mojo/public/cpp/bindings/message_filter.h
index 8e10f6b..638c53b 100644
--- a/mojo/public/cpp/bindings/message_filter.h
+++ b/mojo/public/cpp/bindings/message_filter.h
@@ -6,7 +6,6 @@
 #define MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_FILTER_H_
 
 #include "mojo/public/cpp/bindings/message.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 
diff --git a/mojo/public/cpp/bindings/struct_ptr.h b/mojo/public/cpp/bindings/struct_ptr.h
index 3e907e0..e3b072d 100644
--- a/mojo/public/cpp/bindings/struct_ptr.h
+++ b/mojo/public/cpp/bindings/struct_ptr.h
@@ -8,8 +8,8 @@
 #include <new>
 
 #include "base/logging.h"
+#include "base/move.h"
 #include "mojo/public/cpp/bindings/type_converter.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 namespace internal {
diff --git a/mojo/public/cpp/bindings/tests/BUILD.gn b/mojo/public/cpp/bindings/tests/BUILD.gn
index 7fdb6d2..c689fe31 100644
--- a/mojo/public/cpp/bindings/tests/BUILD.gn
+++ b/mojo/public/cpp/bindings/tests/BUILD.gn
@@ -21,6 +21,7 @@ source_set("tests") {
     "equals_unittest.cc",
     "handle_passing_unittest.cc",
     "interface_ptr_unittest.cc",
+    "macros_unittest.cc",
     "map_unittest.cc",
     "message_queue.cc",
     "message_queue.h",
diff --git a/mojo/public/cpp/bindings/tests/binding_unittest.cc b/mojo/public/cpp/bindings/tests/binding_unittest.cc
index 6e8e578..15b899d 100644
--- a/mojo/public/cpp/bindings/tests/binding_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/binding_unittest.cc
@@ -10,11 +10,11 @@
 #include <stdint.h>
 #include <utility>
 
+#include "base/macros.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom.h"
 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/mojo/public/cpp/bindings/tests/connector_unittest.cc b/mojo/public/cpp/bindings/tests/connector_unittest.cc
index a57459d..04e6bc9 100644
--- a/mojo/public/cpp/bindings/tests/connector_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/connector_unittest.cc
@@ -14,7 +14,6 @@
 #include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/cpp/bindings/lib/message_builder.h"
 #include "mojo/public/cpp/bindings/tests/message_queue.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/public/cpp/bindings/tests/container_test_util.h b/mojo/public/cpp/bindings/tests/container_test_util.h
index ff46b8f..b2038ba 100644
--- a/mojo/public/cpp/bindings/tests/container_test_util.h
+++ b/mojo/public/cpp/bindings/tests/container_test_util.h
@@ -8,7 +8,6 @@
 #include <stddef.h>
 
 #include "base/move.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 
diff --git a/mojo/public/cpp/bindings/tests/macros_unittest.cc b/mojo/public/cpp/bindings/tests/macros_unittest.cc
new file mode 100644
index 0000000..73d6a80
--- /dev/null
+++ b/mojo/public/cpp/bindings/tests/macros_unittest.cc
@@ -0,0 +1,66 @@
+// Copyright 2014 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.
+
+// This file tests the C++ Mojo system macros and consists of "positive" tests,
+// i.e., those verifying that things work (without compile errors, or even
+// warnings if warnings are treated as errors).
+// TODO(vtl): Maybe rename "MacrosCppTest" -> "MacrosTest" if/when this gets
+// compiled into a different binary from the C API tests.
+// TODO(vtl): Fix no-compile tests (which are all disabled; crbug.com/105388)
+// and write some "negative" tests.
+
+#include "mojo/public/cpp/bindings/lib/macros.h"
+
+#include <assert.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <utility>
+
+#include "base/compiler_specific.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace mojo {
+
+// The test for |MOJO_STATIC_CONST_MEMBER_DEFINITION| is really a compile/link
+// test. To test it fully would really require a header file and multiple .cc
+// files, but we'll just cursorily verify it.
+//
+// This is defined outside of an anonymous namespace because
+// MOJO_STATIC_CONST_MEMBER_DEFINITION may not be used on internal symbols.
+struct StructWithStaticConstMember {
+  static const int kStaticConstMember = 123;
+};
+MOJO_STATIC_CONST_MEMBER_DEFINITION
+const int StructWithStaticConstMember::kStaticConstMember;
+
+namespace {
+
+// Note: MSVS is very strict (and arguably buggy) about warnings for classes
+// defined in a local scope, so define these globally.
+struct TestOverrideBaseClass {
+  virtual ~TestOverrideBaseClass() {}
+  virtual void ToBeOverridden() {}
+  virtual void AlsoToBeOverridden() = 0;
+};
+
+struct TestOverrideSubclass : public TestOverrideBaseClass {
+  ~TestOverrideSubclass() override {}
+  void ToBeOverridden() override {}
+  void AlsoToBeOverridden() override {}
+};
+
+TEST(MacrosCppTest, Override) {
+  TestOverrideSubclass x;
+  x.ToBeOverridden();
+  x.AlsoToBeOverridden();
+}
+
+// Use it, to make sure things get linked in and to avoid any warnings about
+// unused things.
+TEST(MacrosCppTest, StaticConstMemberDefinition) {
+  EXPECT_EQ(123, StructWithStaticConstMember::kStaticConstMember);
+}
+
+}  // namespace
+}  // namespace mojo
diff --git a/mojo/public/cpp/bindings/tests/router_unittest.cc b/mojo/public/cpp/bindings/tests/router_unittest.cc
index 1f7160e..804e497 100644
--- a/mojo/public/cpp/bindings/tests/router_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/router_unittest.cc
@@ -11,7 +11,6 @@
 #include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/cpp/bindings/tests/message_queue.h"
 #include "mojo/public/cpp/bindings/tests/router_test_util.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/public/cpp/bindings/tests/validation_unittest.cc b/mojo/public/cpp/bindings/tests/validation_unittest.cc
index 252a31a..d234d66 100644
--- a/mojo/public/cpp/bindings/tests/validation_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/validation_unittest.cc
@@ -175,7 +175,7 @@ void RunValidationTests(const std::string& prefix,
     base::RunLoop run_loop;
     mojo::internal::ValidationErrorObserverForTesting observer(
         run_loop.QuitClosure());
-    mojo_ignore_result(test_message_receiver->Accept(&message));
+    ignore_result(test_message_receiver->Accept(&message));
     if (expected != "PASS")  // Observer only gets called on errors.
       run_loop.Run();
     if (observer.last_error() == mojo::internal::VALIDATION_ERROR_NONE)
diff --git a/mojo/public/cpp/bindings/tests/versioning_apptest.cc b/mojo/public/cpp/bindings/tests/versioning_apptest.cc
index e3d63e1..6eb57cf 100644
--- a/mojo/public/cpp/bindings/tests/versioning_apptest.cc
+++ b/mojo/public/cpp/bindings/tests/versioning_apptest.cc
@@ -5,7 +5,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include "mojo/public/cpp/system/macros.h"
+#include "base/macros.h"
 #include "mojo/public/interfaces/bindings/tests/versioning_test_client.mojom.h"
 #include "mojo/shell/public/cpp/application_test_base.h"
 #include "mojo/shell/public/cpp/connector.h"
diff --git a/mojo/public/cpp/bindings/tests/versioning_test_service.cc b/mojo/public/cpp/bindings/tests/versioning_test_service.cc
index bf3ca87..30296d0 100644
--- a/mojo/public/cpp/bindings/tests/versioning_test_service.cc
+++ b/mojo/public/cpp/bindings/tests/versioning_test_service.cc
@@ -7,9 +7,9 @@
 #include <map>
 #include <utility>
 
+#include "base/macros.h"
 #include "mojo/public/c/system/main.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "mojo/public/interfaces/bindings/tests/versioning_test_service.mojom.h"
 #include "mojo/shell/public/cpp/application_runner.h"
 #include "mojo/shell/public/cpp/interface_factory.h"
diff --git a/mojo/public/cpp/system/BUILD.gn b/mojo/public/cpp/system/BUILD.gn
index dc2d28c..0aef01d 100644
--- a/mojo/public/cpp/system/BUILD.gn
+++ b/mojo/public/cpp/system/BUILD.gn
@@ -9,7 +9,6 @@ source_set("system") {
     "data_pipe.h",
     "functions.h",
     "handle.h",
-    "macros.h",
     "message_pipe.h",
     "watcher.cc",
     "watcher.h",
diff --git a/mojo/public/cpp/system/buffer.h b/mojo/public/cpp/system/buffer.h
index 607aea1e1..a2d524e 100644
--- a/mojo/public/cpp/system/buffer.h
+++ b/mojo/public/cpp/system/buffer.h
@@ -18,7 +18,6 @@
 #include "base/logging.h"
 #include "mojo/public/c/system/buffer.h"
 #include "mojo/public/cpp/system/handle.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 
diff --git a/mojo/public/cpp/system/core.h b/mojo/public/cpp/system/core.h
index b08a5a6..f1d18d9 100644
--- a/mojo/public/cpp/system/core.h
+++ b/mojo/public/cpp/system/core.h
@@ -9,7 +9,6 @@
 #include "mojo/public/cpp/system/data_pipe.h"
 #include "mojo/public/cpp/system/functions.h"
 #include "mojo/public/cpp/system/handle.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "mojo/public/cpp/system/message_pipe.h"
 
 #endif  // MOJO_PUBLIC_CPP_SYSTEM_CORE_H_
diff --git a/mojo/public/cpp/system/data_pipe.h b/mojo/public/cpp/system/data_pipe.h
index c5f9707..0dbc3c7 100644
--- a/mojo/public/cpp/system/data_pipe.h
+++ b/mojo/public/cpp/system/data_pipe.h
@@ -18,7 +18,6 @@
 #include "base/logging.h"
 #include "mojo/public/c/system/data_pipe.h"
 #include "mojo/public/cpp/system/handle.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 
diff --git a/mojo/public/cpp/system/handle.h b/mojo/public/cpp/system/handle.h
index 4df86af..a0c162a 100644
--- a/mojo/public/cpp/system/handle.h
+++ b/mojo/public/cpp/system/handle.h
@@ -14,7 +14,6 @@
 #include "base/move.h"
 #include "mojo/public/c/system/functions.h"
 #include "mojo/public/c/system/types.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 
diff --git a/mojo/public/cpp/system/macros.h b/mojo/public/cpp/system/macros.h
deleted file mode 100644
index 931c978..0000000
--- a/mojo/public/cpp/system/macros.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2014 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.
-
-// Define a set of C++ specific macros.
-// Mojo C++ API users can assume that mojo/public/cpp/system/macros.h
-// includes mojo/public/c/system/macros.h.
-
-#ifndef MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_
-#define MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_
-
-#include <stddef.h>
-
-#include "mojo/public/c/system/macros.h"  // Symbols exposed.
-
-// The C++ standard requires that static const members have an out-of-class
-// definition (in a single compilation unit), but MSVC chokes on this (when
-// language extensions, which are required, are enabled). (You're only likely to
-// notice the need for a definition if you take the address of the member or,
-// more commonly, pass it to a function that takes it as a reference argument --
-// probably an STL function.) This macro makes MSVC do the right thing. See
-// http://msdn.microsoft.com/en-us/library/34h23df8(v=vs.100).aspx for more
-// information. This workaround does not appear to be necessary after VS2015.
-// Use like:
-//
-// In the .h file:
-//   struct Foo {
-//     static const int kBar = 5;
-//   };
-//
-// In the .cc file:
-//   MOJO_STATIC_CONST_MEMBER_DEFINITION const int Foo::kBar;
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define MOJO_STATIC_CONST_MEMBER_DEFINITION __declspec(selectany)
-#else
-#define MOJO_STATIC_CONST_MEMBER_DEFINITION
-#endif
-
-#endif  // MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_
diff --git a/mojo/public/cpp/system/message_pipe.h b/mojo/public/cpp/system/message_pipe.h
index fab23e4..94818e8 100644
--- a/mojo/public/cpp/system/message_pipe.h
+++ b/mojo/public/cpp/system/message_pipe.h
@@ -18,7 +18,6 @@
 #include "base/logging.h"
 #include "mojo/public/c/system/message_pipe.h"
 #include "mojo/public/cpp/system/handle.h"
-#include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
 
diff --git a/mojo/public/cpp/system/tests/BUILD.gn b/mojo/public/cpp/system/tests/BUILD.gn
index b6664af..8f98b92 100644
--- a/mojo/public/cpp/system/tests/BUILD.gn
+++ b/mojo/public/cpp/system/tests/BUILD.gn
@@ -7,7 +7,6 @@ source_set("tests") {
 
   sources = [
     "core_unittest.cc",
-    "macros_unittest.cc",
     "watcher_unittest.cc",
   ]
 
diff --git a/mojo/public/cpp/system/tests/core_unittest.cc b/mojo/public/cpp/system/tests/core_unittest.cc
index 927c554..7a52ab5 100644
--- a/mojo/public/cpp/system/tests/core_unittest.cc
+++ b/mojo/public/cpp/system/tests/core_unittest.cc
@@ -13,7 +13,6 @@
 #include <map>
 #include <utility>
 
-#include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/public/cpp/system/tests/macros_unittest.cc b/mojo/public/cpp/system/tests/macros_unittest.cc
deleted file mode 100644
index 30d7c84..0000000
--- a/mojo/public/cpp/system/tests/macros_unittest.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2014 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.
-
-// This file tests the C++ Mojo system macros and consists of "positive" tests,
-// i.e., those verifying that things work (without compile errors, or even
-// warnings if warnings are treated as errors).
-// TODO(vtl): Maybe rename "MacrosCppTest" -> "MacrosTest" if/when this gets
-// compiled into a different binary from the C API tests.
-// TODO(vtl): Fix no-compile tests (which are all disabled; crbug.com/105388)
-// and write some "negative" tests.
-
-#include "mojo/public/cpp/system/macros.h"
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <utility>
-
-#include "base/compiler_specific.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace mojo {
-
-// The test for |MOJO_STATIC_CONST_MEMBER_DEFINITION| is really a compile/link
-// test. To test it fully would really require a header file and multiple .cc
-// files, but we'll just cursorily verify it.
-//
-// This is defined outside of an anonymous namespace because
-// MOJO_STATIC_CONST_MEMBER_DEFINITION may not be used on internal symbols.
-struct StructWithStaticConstMember {
-  static const int kStaticConstMember = 123;
-};
-MOJO_STATIC_CONST_MEMBER_DEFINITION
-const int StructWithStaticConstMember::kStaticConstMember;
-
-namespace {
-
-// Note: MSVS is very strict (and arguably buggy) about warnings for classes
-// defined in a local scope, so define these globally.
-struct TestOverrideBaseClass {
-  virtual ~TestOverrideBaseClass() {}
-  virtual void ToBeOverridden() {}
-  virtual void AlsoToBeOverridden() = 0;
-};
-
-struct TestOverrideSubclass : public TestOverrideBaseClass {
-  ~TestOverrideSubclass() override {}
-  void ToBeOverridden() override {}
-  void AlsoToBeOverridden() override {}
-};
-
-TEST(MacrosCppTest, Override) {
-  TestOverrideSubclass x;
-  x.ToBeOverridden();
-  x.AlsoToBeOverridden();
-}
-
-// Use it, to make sure things get linked in and to avoid any warnings about
-// unused things.
-TEST(MacrosCppTest, StaticConstMemberDefinition) {
-  EXPECT_EQ(123, StructWithStaticConstMember::kStaticConstMember);
-}
-
-}  // namespace
-}  // namespace mojo
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
index b22f8530..8c9c0fb 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
@@ -28,6 +28,7 @@
 #include "base/trace_event/trace_event.h"
 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h"
 #include "mojo/public/cpp/bindings/lib/bounds_checker.h"
+#include "mojo/public/cpp/bindings/lib/macros.h"
 #include "mojo/public/cpp/bindings/lib/map_data_internal.h"
 #include "mojo/public/cpp/bindings/lib/message_builder.h"
 #include "mojo/public/cpp/bindings/lib/validate_params.h"
diff --git a/mojo/shell/public/cpp/application_test_base.h b/mojo/shell/public/cpp/application_test_base.h
index 4358c6f..54d073a 100644
--- a/mojo/shell/public/cpp/application_test_base.h
+++ b/mojo/shell/public/cpp/application_test_base.h
@@ -5,10 +5,10 @@
 #ifndef MOJO_SHELL_PUBLIC_CPP_APPLICATION_TEST_BASE_H_
 #define MOJO_SHELL_PUBLIC_CPP_APPLICATION_TEST_BASE_H_
 
+#include "base/macros.h"
 #include "base/memory/scoped_ptr.h"
 #include "mojo/public/cpp/bindings/array.h"
 #include "mojo/public/cpp/bindings/string.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "mojo/shell/public/cpp/connector.h"
 #include "mojo/shell/public/cpp/shell_client.h"
 #include "mojo/shell/public/cpp/shell_connection.h"
diff --git a/mojo/shell/public/cpp/shell_client.h b/mojo/shell/public/cpp/shell_client.h
index 5f60316..d6fca12 100644
--- a/mojo/shell/public/cpp/shell_client.h
+++ b/mojo/shell/public/cpp/shell_client.h
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <string>
 
-#include "mojo/public/cpp/system/macros.h"
+#include "base/macros.h"
 #include "mojo/shell/public/cpp/connection.h"
 #include "mojo/shell/public/cpp/identity.h"
 
diff --git a/mojo/shell/public/cpp/shell_test.h b/mojo/shell/public/cpp/shell_test.h
index c3ed59a..9157b676 100644
--- a/mojo/shell/public/cpp/shell_test.h
+++ b/mojo/shell/public/cpp/shell_test.h
@@ -5,8 +5,8 @@
 #ifndef MOJO_SHELL_PUBLIC_CPP_SHELL_TEST_H_
 #define MOJO_SHELL_PUBLIC_CPP_SHELL_TEST_H_
 
+#include "base/macros.h"
 #include "base/memory/scoped_ptr.h"
-#include "mojo/public/cpp/system/macros.h"
 #include "mojo/shell/public/cpp/connector.h"
 #include "mojo/shell/public/cpp/shell_client.h"
 #include "mojo/shell/public/cpp/shell_connection.h"
-- 
cgit v1.1