@@ -449,7 +449,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
449
449
// no support for it at least as recent as Froyo (2.2).
450
450
#define GTEST_HAS_STD_WSTRING \
451
451
(!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
452
- GTEST_OS_HAIKU))
452
+ GTEST_OS_HAIKU || GTEST_OS_ESP32 || GTEST_OS_ESP8266 ))
453
453
454
454
#endif // GTEST_HAS_STD_WSTRING
455
455
@@ -573,7 +573,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
573
573
#ifndef GTEST_HAS_STREAM_REDIRECTION
574
574
// By default, we assume that stream redirection is supported on all
575
575
// platforms except known mobile ones.
576
- # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
576
+ # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266
577
577
# define GTEST_HAS_STREAM_REDIRECTION 0
578
578
# else
579
579
# define GTEST_HAS_STREAM_REDIRECTION 1
@@ -1984,6 +1984,22 @@ inline bool IsDir(const StatStruct& st) {
1984
1984
}
1985
1985
# endif // GTEST_OS_WINDOWS_MOBILE
1986
1986
1987
+ #elif GTEST_OS_ESP8266
1988
+ typedef struct stat StatStruct;
1989
+
1990
+ inline int FileNo (FILE* file) { return fileno (file); }
1991
+ inline int IsATTY (int fd) { return isatty (fd); }
1992
+ inline int Stat (const char * path, StatStruct* buf) {
1993
+ // stat function not implemented on ESP8266
1994
+ return 0 ;
1995
+ }
1996
+ inline int StrCaseCmp (const char * s1, const char * s2) {
1997
+ return strcasecmp (s1, s2);
1998
+ }
1999
+ inline char * StrDup (const char * src) { return strdup (src); }
2000
+ inline int RmDir (const char * dir) { return rmdir (dir); }
2001
+ inline bool IsDir (const StatStruct& st) { return S_ISDIR (st.st_mode ); }
2002
+
1987
2003
#else
1988
2004
1989
2005
typedef struct stat StatStruct;
@@ -2036,7 +2052,7 @@ inline int Close(int fd) { return close(fd); }
2036
2052
inline const char * StrError (int errnum) { return strerror (errnum); }
2037
2053
#endif
2038
2054
inline const char * GetEnv (const char * name) {
2039
- #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
2055
+ #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266
2040
2056
// We are on Windows CE, which has no environment variables.
2041
2057
static_cast <void >(name); // To prevent 'unused argument' warning.
2042
2058
return nullptr ;
0 commit comments