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

Unified Diff: base/bind_unittest.cc

Issue 6561004: Callback support for __fastcall and __stdcall functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: Address will's comments. Created 9 years, 10 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
« base/bind_internal.h.pump ('K') | « base/bind_internal_win.h.pump ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_unittest.cc
diff --git a/base/bind_unittest.cc b/base/bind_unittest.cc
index 77eb98a9189faa7af6b1c073aa45eea76bf8f701..061808b3d0b805b0aab2b067c65a50d39752f389 100644
--- a/base/bind_unittest.cc
+++ b/base/bind_unittest.cc
@@ -581,5 +581,26 @@ TEST_F(BindTest, NoCompile) {
}
+#if defined(OS_WIN)
+int __fastcall FastCallFunc(int n) {
+ return n;
+}
+
+int __stdcall StdCallFunc(int n) {
+ return n;
+}
+
+// Windows specific calling convention support.
+// - Can bind a __fastcall function.
+// - Can bind a __stdcall function.
+TEST_F(BindTest, WindowsCallingConventions) {
+ Callback<int(void)> fastcall_cb = Bind(&FastCallFunc, 1);
+ EXPECT_EQ(1, fastcall_cb.Run());
+
+ Callback<int(void)> stdcall_cb = Bind(&StdCallFunc, 2);
+ EXPECT_EQ(2, stdcall_cb.Run());
+}
+#endif
+
} // namespace
} // namespace base
« base/bind_internal.h.pump ('K') | « base/bind_internal_win.h.pump ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698