added compatibility function for VC14

This commit is contained in:
Frank Morgner 2016-08-05 12:47:48 +02:00
parent 6dc6d4c05d
commit 28958af559
3 changed files with 24 additions and 1 deletions

View File

@ -19,6 +19,7 @@ libcompat_la_SOURCES = \
compat_getpass.h compat_getpass.c \
compat_getopt.h compat_getopt.c \
compat_report_rangecheckfailure.c \
compat___iob_func.c \
simclist.c simclist.h
compat_getopt_main_LDADD = libcompat.la

View File

@ -1,6 +1,6 @@
TOPDIR = ..\..
COMMON_OBJECTS = compat_getpass.obj compat_getopt.obj compat_strlcpy.obj compat_strlcat.obj simclist.obj compat_report_rangecheckfailure.obj
COMMON_OBJECTS = compat_getpass.obj compat_getopt.obj compat_strlcpy.obj compat_strlcat.obj simclist.obj compat_report_rangecheckfailure.obj compat___iob_func.obj
all: common.lib libpkcs11.lib libscdl.lib

View File

@ -0,0 +1,22 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef HAVE_IOB_FUNC /* empty file if iob_func is available */
#ifdef _WIN32
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
// needed for OpenSSL static link
// only for vs 2015 or later
#pragma comment(lib, "legacy_stdio_definitions.lib")
#include <stdio.h>
FILE * __cdecl __iob_func(void)
{
static FILE *my_iob[3];
my_iob[0] = stdin;
my_iob[1] = stdout;
my_iob[2] = stderr;
return my_iob;
}
#endif
#endif
#endif