Skip to content

Commit

Permalink
Merge pull request #2083 from hugolm84/v1.8.x
Browse files Browse the repository at this point in the history
Add missing typedefs for WINCE800 (Windows Embedded Compact 2013)
  • Loading branch information
gennadiycivil committed Jan 30, 2019
2 parents 4fe76c4 + aafc594 commit dea0216
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions googletest/cmake/internal_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ macro(fix_default_compiler_settings_)
# This replacement code is taken from sample in the CMake Wiki at
# https://gitlab.kitware.com/cmake/community/wikis/FAQ#dynamic-replace.
foreach (flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
Expand Down
13 changes: 11 additions & 2 deletions googletest/include/gtest/internal/gtest-port.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,14 @@
#ifndef _WIN32_WCE
# include <sys/types.h>
# include <sys/stat.h>
#endif // !_WIN32_WCE
#elif _WIN32_WCE >= 0x800 // Windows Embedded Compact 2013
// Forward declare instead of including <windows.h> / <windef.h> / <winnt.h>
typedef wchar_t WCHAR;
typedef WCHAR *PWCHAR, *LPWCH, *PWCH;
typedef const WCHAR *LPCWCH, *PCWCH;
typedef __readableTo(sentinel(0)) const WCHAR *LPCWSTR, *PCWSTR;
typedef const WCHAR *LPCWCHAR, *PCWCHAR;
#endif

#if defined __APPLE__
# include <AvailabilityMacros.h>
Expand Down Expand Up @@ -430,6 +437,8 @@
// MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two
// separate (equivalent) structs, instead of using typedef
typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#elif _WIN32_WCE >= 0x800
typedef struct CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#else
// Assume CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
// This assumption is verified by
Expand Down Expand Up @@ -2468,7 +2477,7 @@ inline char* StrDup(const char* src) { return _strdup(src); }
# endif // __BORLANDC__

# if GTEST_OS_WINDOWS_MOBILE
inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
inline int FileNo(FILE* file) { return static_cast<int>(_fileno(file)); }
// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
// time and thus not defined there.
# else
Expand Down

0 comments on commit dea0216

Please sign in to comment.