Skip to content

Commit 89eca83

Browse files
committed
Merge pull request opencv#8123 from msk-repo01:master
2 parents 48f7cbe + 9a1835c commit 89eca83

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

modules/ts/include/opencv2/ts/ts_gtest.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,16 @@
720720
# include <io.h>
721721
# endif
722722
// In order to avoid having to include <windows.h>, use forward declaration
723-
// assuming CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
724-
// This assumption is verified by
725-
// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
726-
struct _RTL_CRITICAL_SECTION;
723+
# if GTEST_OS_WINDOWS_MINGW
724+
// MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two
725+
// separate (equivalent) structs, instead of using typedef
726+
typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;
727+
# else
728+
// assuming CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
729+
// This assumption is verified by
730+
// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
731+
typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
732+
# endif
727733
#else
728734
// This assumes that non-Windows OSes provide unistd.h. For OSes where this
729735
// is not the case, we need to include headers that provide the functions
@@ -3057,7 +3063,7 @@ class GTEST_API_ Mutex {
30573063
// by the linker.
30583064
MutexType type_;
30593065
long critical_section_init_phase_; // NOLINT
3060-
_RTL_CRITICAL_SECTION* critical_section_;
3066+
GTEST_CRITICAL_SECTION* critical_section_;
30613067

30623068
GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
30633069
};

0 commit comments

Comments
 (0)