blob: ec012aa4c781ba4f5979ddd029ebc0fe5a48b44e [file] [log] [blame]
Evgeniy Stepanovbec2f0e2011-03-05 12:50:33 +03001#ifndef TSAN_COMMON_UTIL__
2#define TSAN_COMMON_UTIL__
3
4#include "ts_util.h"
5
6#if defined(__GNUC__)
7 typedef int TS_FILE;
8 #define TS_FILE_INVALID (-1)
9#ifdef TS_LLVM
10 #define read(fd, buf, size) __real_read(fd, buf, size)
11#endif
12#elif defined(_MSC_VER)
13 typedef FILE *TS_FILE;
14 #define TS_FILE_INVALID (NULL)
15 #define read(fd, buf, size) fread(buf, 1, size, fd)
16 #define close fclose
17#endif
18
19bool StringMatch(const string& wildcard, const string& text);
20string ConvertToPlatformIndependentPath(const string &s);
21TS_FILE OpenFileReadOnly(const string &file_name, bool die_if_failed);
22string ReadFileToString(const string &file_name, bool die_if_failed);
23
24#endif