* 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
This commit is contained in:
Vincent Torri 2011-02-23 19:34:27 +00:00
parent 5677e35855
commit 04ccb0a4b4
4 changed files with 52 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2011-02-23 Vincent Torri <doursse at users dot sf dot net>
* 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
2011-02-04 Vincent Torri <doursse at users dot sf dot net>
* src/lib/evil_stdio.c:

View File

@ -217,6 +217,21 @@ int evil_fclose_native(FILE *stream)
int
vasprintf(char **strp, const char *fmt, va_list ap)
{
#ifdef _WIN32_WCE
char buf[1024];
char *res;
int len;
len = _vsnprintf(buf, 1023, fmt, ap);
if (len < 0) return -1;
res = (char *)malloc(len + 1);
if (!res) return -1;
memcpy(res, buf, len);
res[len] = '\0';
#else
char *res;
int len;
@ -224,10 +239,11 @@ vasprintf(char **strp, const char *fmt, va_list ap)
res = (char *)malloc(len);
if (!res) return -1;
*strp = res;
len = vsprintf(res, fmt, ap);
if (len < 0) len = -1;
#endif
*strp = res;
return len;
}

View File

@ -30,3 +30,13 @@ localtime_r(const time_t *timep, struct tm *result)
return result;
}
#ifdef UNDER_CE
void
tzset(void)
{
/* does nothing... */
}
#endif /* UNDER_CE */

View File

@ -25,7 +25,7 @@
* representation. The result is stored in the buffer @p result
* supplied by the user. If @p timep or @p result are @c NULL, or if
* an error occurred, this function returns @c NULL and the values in
* @p result might be undefined. Otherwise it returns @p result.
* @p result might be undefined. Otherwise it returns @p result.
*
* Conformity: Non applicable.
*
@ -33,6 +33,21 @@
*/
EAPI struct tm *localtime_r(const time_t *timep, struct tm *result);
#ifdef UNDER_CE
/**
* @brief Stub implementation of tzset().
*
* This function does nothing.
*
* Conformity: Non applicable.
*
* Supported OS: Windows CE.
*/
EAPI void tzset(void);
#endif
/**
* @}