Skip to content

Commit

Permalink
__cdecl calling convention on main and ostream&(*)(ostream&).
Browse files Browse the repository at this point in the history
pleroy committed May 22, 2021
1 parent 4861bc6 commit 7acebfc
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions googlemock/include/gmock/gmock-matchers.h
Original file line number Diff line number Diff line change
@@ -1145,7 +1145,7 @@ class PairMatchBase {
}

private:
static ::std::ostream& GetDesc(::std::ostream& os) { // NOLINT
static ::std::ostream& __cdecl GetDesc(::std::ostream& os) { // NOLINT
return os << D::Desc();
}

@@ -1766,7 +1766,7 @@ class FloatingEq2Matcher {
}

private:
static ::std::ostream& GetDesc(::std::ostream& os) { // NOLINT
static ::std::ostream& __cdecl GetDesc(::std::ostream& os) { // NOLINT
return os << "an almost-equal pair";
}

2 changes: 1 addition & 1 deletion googlemock/src/gmock_main.cc
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ void loop() { RUN_ALL_TESTS(); }

GTEST_API_ int _tmain(int argc, TCHAR** argv) {
#else
GTEST_API_ int main(int argc, char** argv) {
GTEST_API_ int __cdecl main(int argc, char** argv) {
#endif // GTEST_OS_WINDOWS_MOBILE
std::cout << "Running main() from gmock_main.cc\n";
google::InitGoogleLogging(argv[0]);
2 changes: 1 addition & 1 deletion googlemock/test/gmock-spec-builders_test.cc
Original file line number Diff line number Diff line change
@@ -2763,7 +2763,7 @@ TEST(ParameterlessExpectationsTest,
#if GMOCK_RENAME_MAIN
int gmock_main(int argc, char **argv) {
#else
int main(int argc, char **argv) {
int __cdecl main(int argc, char **argv) {
#endif // GMOCK_RENAME_MAIN
testing::InitGoogleMock(&argc, argv);
// Ensures that the tests pass no matter what value of
2 changes: 1 addition & 1 deletion googletest/include/gtest/gtest-message.h
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@ class GTEST_API_ Message {
private:
// The type of basic IO manipulators (endl, ends, and flush) for
// narrow streams.
typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
typedef std::ostream& (__cdecl *BasicNarrowIoManip)(std::ostream&);

public:
// Constructs an empty Message.
2 changes: 1 addition & 1 deletion googletest/include/gtest/gtest.h
Original file line number Diff line number Diff line change
@@ -345,7 +345,7 @@ class GTEST_API_ AssertionResult {
// Allows streaming basic output manipulators such as endl or flush into
// this object.
AssertionResult& operator<<(
::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
::std::ostream& (__cdecl *basic_manipulator)(::std::ostream& stream)) {
AppendMessage(Message() << basic_manipulator);
return *this;
}
2 changes: 1 addition & 1 deletion googletest/src/gtest_main.cc
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ void loop() { RUN_ALL_TESTS(); }

#else

GTEST_API_ int main(int argc, char **argv) {
GTEST_API_ int __cdecl main(int argc, char **argv) {
printf("Running main() from %s\n", __FILE__);
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();

0 comments on commit 7acebfc

Please sign in to comment.