Fixes a MSVC warning (by Vlad Losev); fixes SConscript to work with VC 7.1 and exceptions enabled (by Zhanyong Wan).
This commit is contained in:
		@@ -735,7 +735,6 @@ namespace posix {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
typedef struct _stat stat_struct;
 | 
					typedef struct _stat stat_struct;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int chdir(const char* dir) { return ::_chdir(dir); }
 | 
					 | 
				
			||||||
// We cannot write ::_fileno() as MSVC defines it as a macro.
 | 
					// We cannot write ::_fileno() as MSVC defines it as a macro.
 | 
				
			||||||
inline int fileno(FILE* file) { return _fileno(file); }
 | 
					inline int fileno(FILE* file) { return _fileno(file); }
 | 
				
			||||||
inline int isatty(int fd) { return ::_isatty(fd); }
 | 
					inline int isatty(int fd) { return ::_isatty(fd); }
 | 
				
			||||||
@@ -757,7 +756,6 @@ inline bool IsDir(const stat_struct& st) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
typedef struct stat stat_struct;
 | 
					typedef struct stat stat_struct;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using ::chdir;
 | 
					 | 
				
			||||||
using ::fileno;
 | 
					using ::fileno;
 | 
				
			||||||
using ::isatty;
 | 
					using ::isatty;
 | 
				
			||||||
using ::stat;
 | 
					using ::stat;
 | 
				
			||||||
@@ -780,6 +778,8 @@ inline const char* strncpy(char* dest, const char* src, size_t n) {
 | 
				
			|||||||
  return ::strncpy(dest, src, n);
 | 
					  return ::strncpy(dest, src, n);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					inline int chdir(const char* dir) { return ::chdir(dir); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline FILE* fopen(const char* path, const char* mode) {
 | 
					inline FILE* fopen(const char* path, const char* mode) {
 | 
				
			||||||
  return ::fopen(path, mode);
 | 
					  return ::fopen(path, mode);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -121,6 +121,11 @@ platform = env_with_exceptions['PLATFORM']
 | 
				
			|||||||
if platform == 'win32':
 | 
					if platform == 'win32':
 | 
				
			||||||
  env_with_exceptions.Append(CCFLAGS = ['/EHsc'])
 | 
					  env_with_exceptions.Append(CCFLAGS = ['/EHsc'])
 | 
				
			||||||
  env_with_exceptions.Append(CPPDEFINES = '_HAS_EXCEPTIONS=1')
 | 
					  env_with_exceptions.Append(CPPDEFINES = '_HAS_EXCEPTIONS=1')
 | 
				
			||||||
 | 
					  # Undoes the _TYPEINFO_ hack, which is unnecessary and only creates
 | 
				
			||||||
 | 
					  # trouble when exceptions are enabled.
 | 
				
			||||||
 | 
					  cppdefines = env_with_exceptions['CPPDEFINES']
 | 
				
			||||||
 | 
					  if '_TYPEINFO_' in cppdefines:
 | 
				
			||||||
 | 
					    cppdefines.remove('_TYPEINFO_')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gtest_ex_obj = env_with_exceptions.Object(target='gtest_ex',
 | 
					gtest_ex_obj = env_with_exceptions.Object(target='gtest_ex',
 | 
				
			||||||
                                          source=gtest_source)
 | 
					                                          source=gtest_source)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -238,7 +238,6 @@ void AdHocTest() {
 | 
				
			|||||||
  EXPECT_EQ(2, 3);
 | 
					  EXPECT_EQ(2, 3);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
// Runs all TESTs, all TEST_Fs, and the ad hoc test.
 | 
					// Runs all TESTs, all TEST_Fs, and the ad hoc test.
 | 
				
			||||||
int RunAllTests() {
 | 
					int RunAllTests() {
 | 
				
			||||||
  AdHocTest();
 | 
					  AdHocTest();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user