diff options
author | Lev Walkin <vlm@lionet.info> | 2014-10-12 18:51:52 -0700 |
---|---|---|
committer | Lev Walkin <vlm@lionet.info> | 2014-10-12 18:51:52 -0700 |
commit | 327899574856571cefc8c0dbf96bf61843e19c70 (patch) | |
tree | 46e184262dbfce9315424dfcc1e001c80f99994b | |
parent | a7591b5c7fc4775fc12cc2e1b407ed436b298c73 (diff) | |
parent | cab30af3eeee62d39f71f2fc1aeb302436fd3c7c (diff) |
merged patch #31
-rw-r--r-- | asn1c/sys-common.h | 2 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | libasn1compiler/asn1c_save.c | 4 | ||||
-rw-r--r-- | libasn1fix/asn1fix_internal.h | 2 | ||||
-rw-r--r-- | skeletons/GeneralizedTime.c | 9 |
5 files changed, 22 insertions, 0 deletions
diff --git a/asn1c/sys-common.h b/asn1c/sys-common.h index cac71c01..9ab1e6bb 100644 --- a/asn1c/sys-common.h +++ b/asn1c/sys-common.h @@ -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 */ diff --git a/configure.ac b/configure.ac index 9d53780d..ca408758 100644 --- a/configure.ac +++ b/configure.ac @@ -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 @@ -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 \ diff --git a/libasn1compiler/asn1c_save.c b/libasn1compiler/asn1c_save.c index d71db199..f3cfcdf2 100644 --- a/libasn1compiler/asn1c_save.c +++ b/libasn1compiler/asn1c_save.c @@ -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) \ diff --git a/libasn1fix/asn1fix_internal.h b/libasn1fix/asn1fix_internal.h index 3ccae818..cfd9ceca 100644 --- a/libasn1fix/asn1fix_internal.h +++ b/libasn1fix/asn1fix_internal.h @@ -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 diff --git a/skeletons/GeneralizedTime.c b/skeletons/GeneralizedTime.c index 943ee459..cd36f034 100644 --- a/skeletons/GeneralizedTime.c +++ b/skeletons/GeneralizedTime.c @@ -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." @@ -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. |