diff options
Diffstat (limited to 'extern/libmv/third_party/glog/src/windows/port.h')
-rw-r--r-- | extern/libmv/third_party/glog/src/windows/port.h | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/extern/libmv/third_party/glog/src/windows/port.h b/extern/libmv/third_party/glog/src/windows/port.h index 4879cbf5f92..3be525e8ce9 100644 --- a/extern/libmv/third_party/glog/src/windows/port.h +++ b/extern/libmv/third_party/glog/src/windows/port.h @@ -41,7 +41,7 @@ #ifndef CTEMPLATE_WINDOWS_PORT_H_ #define CTEMPLATE_WINDOWS_PORT_H_ -#include "config.h" +#include "../config.h" #ifdef _WIN32 @@ -111,12 +111,16 @@ enum { STDIN_FILENO = 0, STDOUT_FILENO = 1, STDERR_FILENO = 2 }; * because they don't always NUL-terminate. :-( We also can't use the * name vsnprintf, since windows defines that (but not snprintf (!)). */ -extern int snprintf(char *str, size_t size, +#ifndef HAVE_SNPRINTF +extern int GOOGLE_GLOG_DLL_DECL snprintf(char *str, size_t size, const char *format, ...); -extern int safe_vsnprintf(char *str, size_t size, +#endif +extern int GOOGLE_GLOG_DLL_DECL safe_vsnprintf(char *str, size_t size, const char *format, va_list ap); #define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap) +#ifndef va_copy #define va_copy(dst, src) (dst) = (src) +#endif /* Windows doesn't support specifying the number of buckets as a * hash_map constructor arg, so we leave this blank. @@ -129,9 +133,6 @@ extern int safe_vsnprintf(char *str, size_t size, typedef int pid_t; #define getpid _getpid -#include <BaseTsd.h> -typedef SSIZE_T ssize_t; - #endif // _MSC_VER // ----------------------------------- THREADS @@ -143,30 +144,13 @@ enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock #define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2)) inline struct tm* localtime_r(const time_t* timep, struct tm* result) { -#if __MINGW32__ - struct tm *local_result; - local_result = localtime (timep); - - if (local_result == NULL || result == NULL) - return NULL; - - memcpy (result, local_result, sizeof (result)); - - return result; -#else localtime_s(result, timep); return result; -#endif } inline char* strerror_r(int errnum, char* buf, size_t buflen) { -#if __MINGW32__ - strncpy(buf, "Not implemented yet", buflen); - return buf; -#else strerror_s(buf, buflen, errnum); return buf; -#endif } #ifndef __cplusplus |