diff options
author | Vincent Torri <vincent.torri@gmail.com> | 2012-04-12 16:12:58 +0000 |
---|---|---|
committer | Vincent Torri <vincent.torri@gmail.com> | 2012-04-12 16:12:58 +0000 |
commit | 2aeedca6c1184130cba6592d9d1da67b5c1cdc08 (patch) | |
tree | f350c5e5c34f505760d92447f5201419beffa2cb /legacy/evil | |
parent | 8be32105cb558a86ba1989e4c8aedc2e915b3220 (diff) |
* NEWS:
* src/lib/evil_time.c:
* src/lib/evil_time.h:
Do not declare and define localtime_r() if it's already defined.
SVN revision: 70155
Diffstat (limited to 'legacy/evil')
-rw-r--r-- | legacy/evil/ChangeLog | 7 | ||||
-rw-r--r-- | legacy/evil/NEWS | 1 | ||||
-rw-r--r-- | legacy/evil/src/lib/evil_time.c | 13 | ||||
-rw-r--r-- | legacy/evil/src/lib/evil_time.h | 4 |
4 files changed, 20 insertions, 5 deletions
diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog index a6f78f8ff5..199e2e8b16 100644 --- a/legacy/evil/ChangeLog +++ b/legacy/evil/ChangeLog | |||
@@ -1,3 +1,10 @@ | |||
1 | 2012-04-12 Vincent Torri <doursse at users dot sf dot net> | ||
2 | |||
3 | * NEWS: | ||
4 | * src/lib/evil_time.c: | ||
5 | * src/lib/evil_time.h: | ||
6 | Do not declare and define localtime_r() if it's already defined. | ||
7 | |||
1 | 2012-03-30 Vincent Torri <doursse at users dot sf dot net> | 8 | 2012-03-30 Vincent Torri <doursse at users dot sf dot net> |
2 | 9 | ||
3 | * NEWS: | 10 | * NEWS: |
diff --git a/legacy/evil/NEWS b/legacy/evil/NEWS index bd0dd371dd..938e40926f 100644 --- a/legacy/evil/NEWS +++ b/legacy/evil/NEWS | |||
@@ -5,6 +5,7 @@ Evil NEWS - User visible changes. | |||
5 | ** Add evil_path_is_absolute() API | 5 | ** Add evil_path_is_absolute() API |
6 | ** Add POSIX printf() family functions | 6 | ** Add POSIX printf() family functions |
7 | ** Add S_ISLNK macro | 7 | ** Add S_ISLNK macro |
8 | ** Do not declare and define localtime_r() if it's already defined | ||
8 | 9 | ||
9 | * Evil 1.0: | 10 | * Evil 1.0: |
10 | 11 | ||
diff --git a/legacy/evil/src/lib/evil_time.c b/legacy/evil/src/lib/evil_time.c index 279ba1c7b5..bcff29eb05 100644 --- a/legacy/evil/src/lib/evil_time.c +++ b/legacy/evil/src/lib/evil_time.c | |||
@@ -5,32 +5,35 @@ | |||
5 | #include "Evil.h" | 5 | #include "Evil.h" |
6 | #include "evil_private.h" | 6 | #include "evil_private.h" |
7 | 7 | ||
8 | #ifndef localtime_r | ||
8 | 9 | ||
9 | struct tm * | 10 | struct tm * |
10 | localtime_r(const time_t *timep, struct tm *result) | 11 | localtime_r(const time_t *timep, struct tm *result) |
11 | { | 12 | { |
12 | #ifndef _MSC_VER | 13 | # ifndef _MSC_VER |
13 | struct tm *tmp; | 14 | struct tm *tmp; |
14 | #endif /* ! _MSC_VER */ | 15 | # endif /* ! _MSC_VER */ |
15 | 16 | ||
16 | if (!timep || !result) | 17 | if (!timep || !result) |
17 | return NULL; | 18 | return NULL; |
18 | 19 | ||
19 | #ifdef _MSC_VER | 20 | # ifdef _MSC_VER |
20 | if (localtime_s(result, timep) != 0) | 21 | if (localtime_s(result, timep) != 0) |
21 | return NULL; | 22 | return NULL; |
22 | #else | 23 | # else |
23 | tmp = localtime(timep); | 24 | tmp = localtime(timep); |
24 | if (!tmp) | 25 | if (!tmp) |
25 | return NULL; | 26 | return NULL; |
26 | 27 | ||
27 | memcpy(result, tmp, sizeof(struct tm)); | 28 | memcpy(result, tmp, sizeof(struct tm)); |
28 | 29 | ||
29 | #endif /* ! _MSC_VER */ | 30 | # endif /* ! _MSC_VER */ |
30 | 31 | ||
31 | return result; | 32 | return result; |
32 | } | 33 | } |
33 | 34 | ||
35 | #endif /* localtime_r */ | ||
36 | |||
34 | #ifdef UNDER_CE | 37 | #ifdef UNDER_CE |
35 | 38 | ||
36 | void | 39 | void |
diff --git a/legacy/evil/src/lib/evil_time.h b/legacy/evil/src/lib/evil_time.h index 4e1a237207..13fc909024 100644 --- a/legacy/evil/src/lib/evil_time.h +++ b/legacy/evil/src/lib/evil_time.h | |||
@@ -13,6 +13,8 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | 15 | ||
16 | #ifndef localtime_r | ||
17 | |||
16 | /** | 18 | /** |
17 | * @brief Convert the calendar time to broken-time representation in a | 19 | * @brief Convert the calendar time to broken-time representation in a |
18 | * user supplied data. | 20 | * user supplied data. |
@@ -33,6 +35,8 @@ | |||
33 | */ | 35 | */ |
34 | EAPI struct tm *localtime_r(const time_t *timep, struct tm *result); | 36 | EAPI struct tm *localtime_r(const time_t *timep, struct tm *result); |
35 | 37 | ||
38 | #endif /* localtime_r */ | ||
39 | |||
36 | #ifdef UNDER_CE | 40 | #ifdef UNDER_CE |
37 | 41 | ||
38 | /** | 42 | /** |