annotate Resources/Patches/glog-port-h-v2.diff @ 1794:bdfae6e17d23 worklists

integration mainline->worklists
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Nov 2015 16:02:35 +0100
parents 0d9812893262
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1381
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
1 124,130c124,146
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
2 < // ----------------------------------- THREADS
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
3 < typedef DWORD pthread_t;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
4 < typedef DWORD pthread_key_t;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
5 < typedef LONG pthread_once_t;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
6 < enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
7 < #define pthread_self GetCurrentThreadId
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
8 < #define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2))
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
9 ---
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
10 > // ----------------------------------- SECURE STRINGS
1379
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
11 >
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
12 > #if HAVE_SECURE_STRING_EXTENSIONS == 0
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
13 > // Emulation of "localtime_s" and "strerror_s" for old versions of MinGW
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
14 > inline int localtime_s(tm * _tm, const time_t * time)
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
15 > {
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
16 > tm * posix_local_time_struct = localtime(time);
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
17 > if (posix_local_time_struct == NULL)
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
18 > {
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
19 > return 1;
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
20 > }
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
21 >
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
22 > *_tm = *posix_local_time_struct;
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
23 >
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
24 > return 0;
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
25 > }
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
26 >
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
27 > inline char* strerror_s(char* buf, size_t buflen, int errnum)
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
28 > {
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
29 > const char* str = strerror(errnum);
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
30 > return strncpy(buf, str, buflen - 1);
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
31 > }
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
32 > #endif
1381
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
33 131a148,149
1379
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
34 >
1380
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1379
diff changeset
35 > #if !defined(__MINGW32__) || HAVE_SECURE_STRING_EXTENSIONS == 0
1381
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
36 135a154,155
1378
5dabfaf6034b forgotten file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 > #endif
1379
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1378
diff changeset
38 >
1381
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
39 140a161,173
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
40 >
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
41 >
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
42 > // ----------------------------------- THREADS
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
43 >
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
44 > #if !defined(__MINGW32__) || HAVE_WIN_PTHREAD == 0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
45 > typedef DWORD pthread_t;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
46 > typedef DWORD pthread_key_t;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
47 > typedef LONG pthread_once_t;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
48 > enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
49 > #define pthread_self GetCurrentThreadId
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
50 > #define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2))
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
51 > #endif
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1380
diff changeset
52 >