Go to the documentation of this file.
41 #ifndef CTEMPLATE_WINDOWS_PORT_H_
42 #define CTEMPLATE_WINDOWS_PORT_H_
48 #ifndef WIN32_LEAN_AND_MEAN
49 #define WIN32_LEAN_AND_MEAN
65 #include <glog/logging.h>
79 #pragma warning(disable:4244 4251 4355 4715 4800 4996 4267 4312 4722)
83 #define access _access
84 #define getcwd _getcwd
91 #define pclose _pclose
93 #define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
95 #define O_WRONLY _O_WRONLY
96 #define O_CREAT _O_CREAT
97 #define O_EXCL _O_EXCL
100 enum { STDIN_FILENO = 0, STDOUT_FILENO = 1, STDERR_FILENO = 2 };
102 #define S_IRUSR S_IREAD
103 #define S_IWUSR S_IWRITE
106 #define link(oldpath, newpath) CopyFileA(oldpath, newpath, false)
108 #define strcasecmp _stricmp
109 #define strncasecmp _strnicmp
113 #if defined(_MSC_VER) && (_MSC_VER < 1700)
114 #define hash hash_compare
118 #define sleep(secs) Sleep((secs) * 1000)
124 #ifndef HAVE_SNPRINTF
129 const char*
format, va_list ap);
130 #define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap)
132 #define va_copy(dst, src) (dst) = (src)
138 #define CTEMPLATE_SMALL_HASHTABLE
140 #define DEFAULT_TEMPLATE_ROOTDIR ".."
144 #define getpid _getpid
149 #if defined(HAVE_PTHREAD)
150 # include <pthread.h>
152 typedef DWORD pthread_t;
153 typedef DWORD pthread_key_t;
154 typedef LONG pthread_once_t;
155 enum { PTHREAD_ONCE_INIT = 0 };
156 #define pthread_self GetCurrentThreadId
157 #define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2))
158 #endif // HAVE_PTHREAD
160 #ifndef HAVE_LOCALTIME_R
163 #endif // not HAVE_LOCALTIME_R
165 #ifndef HAVE_GMTIME_R
167 #endif // not HAVE_GMTIME_R
169 inline char* strerror_r(
int errnum,
char*
buf,
size_t buflen) {
170 strerror_s(
buf, buflen, errnum);
struct tm * localtime_r(const time_t *timep, struct tm *result)
int safe_vsnprintf(char *str, size_t size, const char *format, va_list ap)
struct tm * gmtime_r(const time_t *timep, struct tm *result)
int snprintf(char *str, size_t size, const char *format,...)
GLint GLint GLsizei GLint GLenum format
GLenum GLuint GLenum GLsizei const GLchar * buf
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:57