- added localtime_s and gmtime_s function calls to GeneralizedTime.c for VC compiler

- prepared for release 0.8.5
This commit is contained in:
Michael Zillgith 2015-02-25 14:28:57 +01:00
parent 4a4250ce2b
commit c98470f42f
4 changed files with 39 additions and 10 deletions

View file

@ -103,8 +103,12 @@ LIB_OBJS = $(call src_to,.o,$(LIB_SOURCES))
CFLAGS += -std=gnu99
#CFLAGS += -Wno-error=format
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wstrict-prototypes
ifneq ($(HAL_IMPL), WIN32)
CFLAGS += -Wuninitialized
endif
CFLAGS += -Wsign-compare
CFLAGS += -Wpointer-arith
CFLAGS += -Wnested-externs

View file

@ -135,7 +135,7 @@ LinkedList_get(LinkedList self, int index);
* \param self the LinkedList instance
*/
LinkedList
LinkedList_getNext(LinkedList listElement);
LinkedList_getNext(LinkedList self);
/**
* \brief Get the last element in the list.

View file

@ -151,7 +151,7 @@ LinkedList_insertAfter(LinkedList list, void* data)
return newElement;
}
LinkedList inline
LinkedList
LinkedList_getNext(LinkedList list)
{
return list->next;

View file

@ -32,13 +32,8 @@ static struct tm *gmtime_r(const time_t *tloc, struct tm *result) {
#endif /* __IAR_SYSTEMS_ICC__ */
#if defined(WIN32)
#pragma message( "PLEASE STOP AND READ!")
#pragma message( " localtime_r is implemented via localtime(), which may be not thread-safe.")
#pragma message( " gmtime_r is implemented via gmtime(), which may be not thread-safe.")
#pragma message( " ")
#pragma message( " You must fix the code by inserting appropriate locking")
#pragma message( " if you want to use asn_GT2time() or asn_UT2time().")
#pragma message( "PLEASE STOP AND READ!")
#ifdef __GNUC__
static struct tm *localtime_r(const time_t *tloc, struct tm *result) {
struct tm *tm;
@ -54,6 +49,36 @@ static struct tm *gmtime_r(const time_t *tloc, struct tm *result) {
return 0;
}
#else
int
localtime_s(struct tm* _tm, const time_t *time);
int
gmtime_s(struct tm* _tm, const time_t* time);
static struct tm*
localtime_r(const time_t *tloc, struct tm *result)
{
if(localtime_s(result, tloc) == 0)
return result;
else
return 0;
}
static struct tm*
gmtime_r(const time_t *tloc, struct tm *result)
{
if(gmtime_s(result, tloc) == 0)
return result;
else
return 0;
}
#endif /* __GNUC__ */
#define tzset() _tzset()
#define putenv(c) _putenv(c)
#define _EMULATE_TIMEGM