@@ -446,7 +446,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
446
446
// no support for it at least as recent as Froyo (2.2).
447
447
#define GTEST_HAS_STD_WSTRING \
448
448
(!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
449
- GTEST_OS_HAIKU))
449
+ GTEST_OS_HAIKU || GTEST_OS_ESP32 || GTEST_OS_ESP8266 ))
450
450
451
451
#endif // GTEST_HAS_STD_WSTRING
452
452
@@ -570,7 +570,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
570
570
#ifndef GTEST_HAS_STREAM_REDIRECTION
571
571
// By default, we assume that stream redirection is supported on all
572
572
// platforms except known mobile ones.
573
- # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
573
+ #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || \
574
+ GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266
574
575
# define GTEST_HAS_STREAM_REDIRECTION 0
575
576
# else
576
577
# define GTEST_HAS_STREAM_REDIRECTION 1
@@ -1975,6 +1976,22 @@ inline bool IsDir(const StatStruct& st) {
1975
1976
}
1976
1977
# endif // GTEST_OS_WINDOWS_MOBILE
1977
1978
1979
+ #elif GTEST_OS_ESP8266
1980
+ typedef struct stat StatStruct;
1981
+
1982
+ inline int FileNo (FILE* file) { return fileno (file); }
1983
+ inline int IsATTY (int fd) { return isatty (fd); }
1984
+ inline int Stat (const char * path, StatStruct* buf) {
1985
+ // stat function not implemented on ESP8266
1986
+ return 0 ;
1987
+ }
1988
+ inline int StrCaseCmp (const char * s1, const char * s2) {
1989
+ return strcasecmp (s1, s2);
1990
+ }
1991
+ inline char * StrDup (const char * src) { return strdup (src); }
1992
+ inline int RmDir (const char * dir) { return rmdir (dir); }
1993
+ inline bool IsDir (const StatStruct& st) { return S_ISDIR (st.st_mode ); }
1994
+
1978
1995
#else
1979
1996
1980
1997
typedef struct stat StatStruct;
@@ -2023,8 +2040,9 @@ inline int Close(int fd) { return close(fd); }
2023
2040
inline const char * StrError (int errnum) { return strerror (errnum); }
2024
2041
#endif
2025
2042
inline const char * GetEnv (const char * name) {
2026
- #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
2027
- // We are on Windows CE, which has no environment variables.
2043
+ #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || \
2044
+ GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266
2045
+ // We are on an embedded platform, which has no environment variables.
2028
2046
static_cast <void >(name); // To prevent 'unused argument' warning.
2029
2047
return nullptr ;
2030
2048
#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
0 commit comments