annotate Resources/Patches/glog-port-h.diff @ 822:7ce875531950

fix mainline version
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 08 May 2014 17:16:10 +0200
parents 5bae1ac18ded
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 --- /tmp/m/glog-0.3.2/src/windows/port.h 2012-10-03 12:54:10.958149861 +0200
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 +++ port.h 2012-10-03 16:19:56.721837994 +0200
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 @@ -129,6 +129,27 @@
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 #define pthread_self GetCurrentThreadId
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 #define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2))
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 +#if defined(__MINGW32__)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 +inline int localtime_s(tm * _tm, const time_t * time)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 +{
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 + tm * posix_local_time_struct = localtime(time);
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 + if (posix_local_time_struct == NULL)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 + {
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 + return 1;
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 + }
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 +
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 + *_tm = *posix_local_time_struct;
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 +
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 + return 0;
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 +}
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 +
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 +inline char* strerror_s(char* buf, size_t buflen, int errnum)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 +{
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 + const char* str = strerror(errnum);
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 + return strncpy(buf, str, buflen - 1);
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 +}
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 +#endif
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 +
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 inline struct tm* localtime_r(const time_t* timep, struct tm* result) {
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 localtime_s(result, timep);
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 return result;