Am 11.01.2011 14:40, schrieb Guenter via RT:
> Borland C++ 5.5 does not use underscored _ftime and _timeb, therefore
> code in ./crypto/bio/bss_dgram.c and ./ssl/d1_lib.c breaks. The quick
> hack to fix this would be to add defines in e_os.h in the __BORLANDC__
> block:
> --- e_os.h.orig Mon May 31 14:18:08 2010
> +++ e_os.h      Tue Jan 11 12:41:04 2011
> @@ -348,6 +348,8 @@
>    #    define _O_BINARY O_BINARY
>    #    define _int64 __int64
>    #    define _kbhit kbhit
> +#    define _ftime ftime
> +#    define _timeb timeb
>    #  endif
>
>    #  define EXIT(n) exit(n)
>
> but I'd suggest to go another route and clean up the code in
> ./crypto/bio/bss_dgram.c and ./ssl/d1_lib.c a bit:
> --- e_os.h.orig       Mon May 31 14:18:08 2010
> +++ e_os.h    Tue Jan 11 12:51:05 2011
> @@ -345,12 +345,15 @@
>    #  if defined (__BORLANDC__)
>    #    define _setmode setmode
>    #    define _O_TEXT O_TEXT
>    #    define _O_BINARY O_BINARY
>    #    define _int64 __int64
>    #    define _kbhit kbhit
> +#  else
> +#    define ftime _ftime
> +#    define timeb _timeb
>    #  endif
>
>    #  define EXIT(n) exit(n)
>    #  define LIST_SEPARATOR_CHAR ';'
>    #  ifndef X_OK
>    #    define X_OK   0
> #############################################################
> --- crypto/bio/bss_dgram.c.orig       Thu Jan 07 11:44:21 2010
> +++ crypto/bio/bss_dgram.c    Tue Jan 11 12:54:43 2011
> @@ -814,12 +814,7 @@
>
>    static void get_current_time(struct timeval *t)
>       {
> -#ifdef OPENSSL_SYS_WIN32
> -     struct _timeb tb;
> -     _ftime(&tb);
> -     t->tv_sec = (long)tb.time;
> -     t->tv_usec = (long)tb.millitm * 1000;
> -#elif defined(OPENSSL_SYS_VMS)
> +#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS)
>       struct timeb tb;
>       ftime(&tb);
>       t->tv_sec = (long)tb.time;
> #############################################################
> --- ssl/d1_lib.c.orig Tue Apr 06 13:29:21 2010
> +++ ssl/d1_lib.c      Tue Jan 11 12:56:21 2011
> @@ -364,12 +364,7 @@
>
>    static void get_current_time(struct timeval *t)
>    {
> -#ifdef OPENSSL_SYS_WIN32
> -     struct _timeb tb;
> -     _ftime(&tb);
> -     t->tv_sec = (long)tb.time;
> -     t->tv_usec = (long)tb.millitm * 1000;
> -#elif defined(OPENSSL_SYS_VMS)
> +#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS)
>       struct timeb tb;
>       ftime(&tb);
>       t->tv_sec = (long)tb.time;
>
> attached patch is against OpenSSL 1.0.0c.
the same fix should be applied to OpenSSL 0.9.8 branch as well.



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to