Commit a77e8b4e authored by Lev Walkin's avatar Lev Walkin

Merged http://github.com/vlm/asn1c/pull/31: compiling on Win32.

parents a7591b5c 32789957
...@@ -64,7 +64,9 @@ ...@@ -64,7 +64,9 @@
#ifndef EX_OSFILE #ifndef EX_OSFILE
#define EX_OSFILE 72 #define EX_OSFILE 72
#endif #endif
#if defined HAVE_DECL_ALLOCA && !HAVE_DECL_ALLOCA
#define alloca _alloca #define alloca _alloca
#endif
#define snprintf _snprintf #define snprintf _snprintf
#endif /* _WIN32 */ #endif /* _WIN32 */
...@@ -19,6 +19,9 @@ AC_PROG_YACC ...@@ -19,6 +19,9 @@ AC_PROG_YACC
AM_PROG_LEX AM_PROG_LEX
AC_PATH_PROG(AR, ar, ar, $PATH:/usr/ucb:/usr/ccs/bin) dnl for Solaris 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 case "$host_os" in
cygwin) cygwin)
case "$target" in case "$target" in
...@@ -94,6 +97,8 @@ AC_CHECK_FUNCS(strtoimax strtoll) ...@@ -94,6 +97,8 @@ AC_CHECK_FUNCS(strtoimax strtoll)
AC_CHECK_FUNCS(mergesort) AC_CHECK_FUNCS(mergesort)
AC_CHECK_FUNCS(mkstemps) AC_CHECK_FUNCS(mkstemps)
AC_CHECK_FUNCS(timegm) 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( \ AC_OUTPUT( \
skeletons/tests/Makefile \ skeletons/tests/Makefile \
......
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
#include "asn1c_save.h" #include "asn1c_save.h"
#include "asn1c_out.h" #include "asn1c_out.h"
#ifndef HAVE_SYMLINK
#define symlink(a,b) (errno=ENOSYS, -1)
#endif
#define HINCLUDE(s) \ #define HINCLUDE(s) \
((arg->flags & A1C_INCLUDES_QUOTED) \ ((arg->flags & A1C_INCLUDES_QUOTED) \
? fprintf(fp_h, "#include \"%s\"\n", s) \ ? fprintf(fp_h, "#include \"%s\"\n", s) \
......
...@@ -27,8 +27,10 @@ ...@@ -27,8 +27,10 @@
#define EX_NOINPUT 66 #define EX_NOINPUT 66
#define EX_DATAERR 65 #define EX_DATAERR 65
#define snprintf _snprintf #define snprintf _snprintf
#if defined HAVE_DECL_STRCASECMP && !HAVE_DECL_STRCASECMP
#define strcasecmp stricmp #define strcasecmp stricmp
#endif #endif
#endif
#ifndef ETOOMANYREFS #ifndef ETOOMANYREFS
#define ETOOMANYREFS 144 #define ETOOMANYREFS 144
......
...@@ -67,6 +67,14 @@ static struct tm *gmtime_r(const time_t *tloc, struct tm *result) { ...@@ -67,6 +67,14 @@ static struct tm *gmtime_r(const time_t *tloc, struct tm *result) {
#define GMTOFF(tm) (-timezone) #define GMTOFF(tm) (-timezone)
#endif /* HAVE_TM_GMTOFF */ #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)) #if (defined(_EMULATE_TIMEGM) || !defined(HAVE_TM_GMTOFF))
#warning "PLEASE STOP AND READ!" #warning "PLEASE STOP AND READ!"
#warning " timegm() is implemented via getenv(\"TZ\")/setenv(\"TZ\"), which may be not thread-safe." #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) { ...@@ -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 " if you want to use asn_GT2time() or asn_UT2time()."
#warning "PLEASE STOP AND READ!" #warning "PLEASE STOP AND READ!"
#endif /* _EMULATE_TIMEGM */ #endif /* _EMULATE_TIMEGM */
#endif
/* /*
* Override our GMTOFF decision for other known platforms. * Override our GMTOFF decision for other known platforms.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment