Skip to content

Commit

Permalink
merged patch #31
Browse files Browse the repository at this point in the history
  • Loading branch information
vlm committed Oct 13, 2014
2 parents a7591b5 + cab30af commit 3278995
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions asn1c/sys-common.h
Expand Up @@ -64,7 +64,9 @@
#ifndef EX_OSFILE
#define EX_OSFILE 72
#endif
#if defined HAVE_DECL_ALLOCA && !HAVE_DECL_ALLOCA
#define alloca _alloca
#endif
#define snprintf _snprintf
#endif /* _WIN32 */

5 changes: 5 additions & 0 deletions configure.ac
Expand Up @@ -19,6 +19,9 @@ AC_PROG_YACC
AM_PROG_LEX
AC_PATH_PROG(AR, ar, ar, $PATH:/usr/ucb:/usr/ccs/bin) dnl for Solaris

dnl If you need to see the details, just run make V=1.
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

case "$host_os" in
cygwin)
case "$target" in
Expand Down Expand Up @@ -94,6 +97,8 @@ AC_CHECK_FUNCS(strtoimax strtoll)
AC_CHECK_FUNCS(mergesort)
AC_CHECK_FUNCS(mkstemps)
AC_CHECK_FUNCS(timegm)
AC_CHECK_DECLS(alloca strcasecmp)
AC_TRY_LINK_FUNC([symlink],[AC_DEFINE([HAVE_SYMLINK], 1, [Define to 1 if you have the symlink function.])])

AC_OUTPUT( \
skeletons/tests/Makefile \
Expand Down
4 changes: 4 additions & 0 deletions libasn1compiler/asn1c_save.c
Expand Up @@ -6,6 +6,10 @@
#include "asn1c_save.h"
#include "asn1c_out.h"

#ifndef HAVE_SYMLINK
#define symlink(a,b) (errno=ENOSYS, -1)
#endif

#define HINCLUDE(s) \
((arg->flags & A1C_INCLUDES_QUOTED) \
? fprintf(fp_h, "#include \"%s\"\n", s) \
Expand Down
2 changes: 2 additions & 0 deletions libasn1fix/asn1fix_internal.h
Expand Up @@ -27,8 +27,10 @@
#define EX_NOINPUT 66
#define EX_DATAERR 65
#define snprintf _snprintf
#if defined HAVE_DECL_STRCASECMP && !HAVE_DECL_STRCASECMP
#define strcasecmp stricmp
#endif
#endif

#ifndef ETOOMANYREFS
#define ETOOMANYREFS 144
Expand Down
9 changes: 9 additions & 0 deletions skeletons/GeneralizedTime.c
Expand Up @@ -67,6 +67,14 @@ static struct tm *gmtime_r(const time_t *tloc, struct tm *result) {
#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."
Expand All @@ -75,6 +83,7 @@ static struct tm *gmtime_r(const time_t *tloc, struct tm *result) {
#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.
Expand Down

0 comments on commit 3278995

Please sign in to comment.