#include "asn1/asn1c/asn_internal.h"
#include "asn1/asn1c/GeneralizedTime.h"
-#ifdef __CYGWIN__
-#include "/usr/include/time.h"
-#else
#include <time.h>
-#endif /* __CYGWIN__ */
-
#include <stdio.h>
#include <errno.h>
-#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!")
-
-static struct tm *localtime_r(const time_t *tloc, struct tm *result) {
- struct tm *tm;
- if((tm = localtime(tloc)))
- return memcpy(result, tm, sizeof(struct tm));
- return 0;
-}
-
-static struct tm *gmtime_r(const time_t *tloc, struct tm *result) {
- struct tm *tm;
- if((tm = gmtime(tloc)))
- return memcpy(result, tm, sizeof(struct tm));
- return 0;
-}
-
-#define tzset() _tzset()
-#define putenv(c) _putenv(c)
-#define _EMULATE_TIMEGM
-
-#endif /* _WIN32 */
-
#if defined(sun) || defined(__sun) || defined(__solaris__)
#define _EMULATE_TIMEGM
#endif
#define GMTOFF(tm) (-timezone)
#endif /* HAVE_TM_GMTOFF */
-#if defined(_WIN32)
-#pragma message( "PLEASE STOP AND READ!")
-#pragma message( " timegm() is implemented via getenv(\"TZ\")/setenv(\"TZ\"), 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!")
-#else
#if (defined(_EMULATE_TIMEGM) || !defined(HAVE_TM_GMTOFF))
#warning "PLEASE STOP AND READ!"
#warning " timegm() is implemented via getenv(\"TZ\")/setenv(\"TZ\"), which may be not thread-safe."
#warning " if you want to use asn_GT2time() or asn_UT2time()."
#warning "PLEASE STOP AND READ!"
#endif /* _EMULATE_TIMEGM */
-#endif
-
-/*
- * Override our GMTOFF decision for other known platforms.
- */
-#ifdef __CYGWIN__
-#undef GMTOFF
-static long GMTOFF(struct tm a){
- struct tm *lt;
- time_t local_time, gmt_time;
- long zone;
-
- tzset();
- gmt_time = time (NULL);
-
- lt = gmtime(&gmt_time);
-
- local_time = mktime(lt);
- return (gmt_time - local_time);
-}
-#define _EMULATE_TIMEGM
-
-#endif /* __CYGWIN__ */
#define ATZVARS do { \
char tzoldbuf[64]; \
#include <stdarg.h> /* For va_start */
#include <stddef.h> /* for offsetof and ptrdiff_t */
-#ifdef _WIN32
-
-#include <malloc.h>
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-
-/* To avoid linking with ws2_32.lib, here's the definition of ntohl() */
-#define sys_ntohl(l) ((((l) << 24) & 0xff000000) \
- | (((l) << 8) & 0xff0000) \
- | (((l) >> 8) & 0xff00) \
- | ((l >> 24) & 0xff))
-
-#ifdef _MSC_VER /* MSVS.Net */
-#ifndef __cplusplus
-#define inline __inline
-#endif
-#ifndef ASSUMESTDTYPES /* Standard types have been defined elsewhere */
-#define ssize_t SSIZE_T
-#if _MSC_VER < 1600
-typedef char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-#else /* _MSC_VER >= 1600 */
-#include <stdint.h>
-#endif /* _MSC_VER < 1600 */
-#endif /* ASSUMESTDTYPES */
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <float.h>
-#define isnan _isnan
-#define finite _finite
-#define copysign _copysign
-#define ilogb _logb
-#else /* !_MSC_VER */
-#include <stdint.h>
-#endif /* _MSC_VER */
-
-#else /* !_WIN32 */
-
#if defined(__vxworks)
#include <types/vxTypes.h>
#else /* !defined(__vxworks) */
#define sys_ntohl(foo) ntohl(foo)
#endif /* defined(__vxworks) */
-#endif /* _WIN32 */
-
#if __GNUC__ >= 3 || defined(__clang__)
#define CC_ATTRIBUTE(attr) __attribute__((attr))
#else
} while (0)
#endif
-/* a number of the hash function use uint32_t which isn't defined on Pre VS2010 */
-#if defined(_WIN32)
-#if defined(_MSC_VER) && _MSC_VER >= 1600
#include <stdint.h>
-#elif defined(__WATCOMC__) || defined(__MINGW32__) || defined(__CYGWIN__)
-#include <stdint.h>
-#else
-typedef unsigned int uint32_t;
-typedef unsigned char uint8_t;
-#endif
-#elif defined(__GNUC__) && !defined(__VXWORKS__)
-#include <stdint.h>
-#else
-typedef unsigned int uint32_t;
-typedef unsigned char uint8_t;
-#endif
#ifndef uthash_malloc
#define uthash_malloc(sz) malloc(sz) /* malloc fcn */