summaryrefslogtreecommitdiff
path: root/legacy/evil
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2011-02-23 19:34:27 +0000
committerVincent Torri <vincent.torri@gmail.com>2011-02-23 19:34:27 +0000
commit04ccb0a4b467239d903e72897515ac50bfb65204 (patch)
tree9333ea5c43f7a0c4b3a2e0883fa328b031813661 /legacy/evil
parent5677e358559565809eb85bd3ba28738675987d67 (diff)
* src/lib/evil_stdio.c:
make vasprintf() compile on Windows CE * src/lib/evil_time.c: * src/lib/evil_time.h: add stub tzset() for Windows CE SVN revision: 57273
Diffstat (limited to 'legacy/evil')
-rw-r--r--legacy/evil/ChangeLog9
-rw-r--r--legacy/evil/src/lib/evil_stdio.c18
-rw-r--r--legacy/evil/src/lib/evil_time.c10
-rw-r--r--legacy/evil/src/lib/evil_time.h17
4 files changed, 52 insertions, 2 deletions
diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog
index c1f9fe0143..f9bf1b8352 100644
--- a/legacy/evil/ChangeLog
+++ b/legacy/evil/ChangeLog
@@ -1,3 +1,12 @@
12011-02-23 Vincent Torri <doursse at users dot sf dot net>
2
3 * src/lib/evil_stdio.c:
4 make vasprintf() compile on Windows CE
5
6 * src/lib/evil_time.c:
7 * src/lib/evil_time.h:
8 add stub tzset() for Windows CE
9
12011-02-04 Vincent Torri <doursse at users dot sf dot net> 102011-02-04 Vincent Torri <doursse at users dot sf dot net>
2 11
3 * src/lib/evil_stdio.c: 12 * src/lib/evil_stdio.c:
diff --git a/legacy/evil/src/lib/evil_stdio.c b/legacy/evil/src/lib/evil_stdio.c
index cf44367709..d0e4202721 100644
--- a/legacy/evil/src/lib/evil_stdio.c
+++ b/legacy/evil/src/lib/evil_stdio.c
@@ -217,6 +217,21 @@ int evil_fclose_native(FILE *stream)
217int 217int
218vasprintf(char **strp, const char *fmt, va_list ap) 218vasprintf(char **strp, const char *fmt, va_list ap)
219{ 219{
220#ifdef _WIN32_WCE
221 char buf[1024];
222 char *res;
223 int len;
224
225 len = _vsnprintf(buf, 1023, fmt, ap);
226 if (len < 0) return -1;
227
228 res = (char *)malloc(len + 1);
229 if (!res) return -1;
230
231 memcpy(res, buf, len);
232 res[len] = '\0';
233
234#else
220 char *res; 235 char *res;
221 int len; 236 int len;
222 237
@@ -224,10 +239,11 @@ vasprintf(char **strp, const char *fmt, va_list ap)
224 res = (char *)malloc(len); 239 res = (char *)malloc(len);
225 if (!res) return -1; 240 if (!res) return -1;
226 241
227 *strp = res;
228 len = vsprintf(res, fmt, ap); 242 len = vsprintf(res, fmt, ap);
229 if (len < 0) len = -1; 243 if (len < 0) len = -1;
244#endif
230 245
246 *strp = res;
231 return len; 247 return len;
232} 248}
233 249
diff --git a/legacy/evil/src/lib/evil_time.c b/legacy/evil/src/lib/evil_time.c
index 80fbae1569..279ba1c7b5 100644
--- a/legacy/evil/src/lib/evil_time.c
+++ b/legacy/evil/src/lib/evil_time.c
@@ -30,3 +30,13 @@ localtime_r(const time_t *timep, struct tm *result)
30 30
31 return result; 31 return result;
32} 32}
33
34#ifdef UNDER_CE
35
36void
37tzset(void)
38{
39 /* does nothing... */
40}
41
42#endif /* UNDER_CE */
diff --git a/legacy/evil/src/lib/evil_time.h b/legacy/evil/src/lib/evil_time.h
index 1594c77ef6..4e1a237207 100644
--- a/legacy/evil/src/lib/evil_time.h
+++ b/legacy/evil/src/lib/evil_time.h
@@ -25,7 +25,7 @@
25 * representation. The result is stored in the buffer @p result 25 * representation. The result is stored in the buffer @p result
26 * supplied by the user. If @p timep or @p result are @c NULL, or if 26 * supplied by the user. If @p timep or @p result are @c NULL, or if
27 * an error occurred, this function returns @c NULL and the values in 27 * an error occurred, this function returns @c NULL and the values in
28 * @p result might be undefined. Otherwise it returns @p result. 28 * @p result might be undefined. Otherwise it returns @p result.
29 * 29 *
30 * Conformity: Non applicable. 30 * Conformity: Non applicable.
31 * 31 *
@@ -33,6 +33,21 @@
33 */ 33 */
34EAPI struct tm *localtime_r(const time_t *timep, struct tm *result); 34EAPI struct tm *localtime_r(const time_t *timep, struct tm *result);
35 35
36#ifdef UNDER_CE
37
38/**
39 * @brief Stub implementation of tzset().
40 *
41 * This function does nothing.
42 *
43 * Conformity: Non applicable.
44 *
45 * Supported OS: Windows CE.
46 */
47EAPI void tzset(void);
48
49#endif
50
36 51
37/** 52/**
38 * @} 53 * @}