[pkg-opensc-commit] [opensc] 91/295: added compatibility function for VC14

Eric Dorland eric at moszumanska.debian.org
Sat Jun 24 21:11:19 UTC 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository opensc.

commit 28958af5597cbe2060a47092e2f4c0844fb4b779
Author: Frank Morgner <frankmorgner at gmail.com>
Date:   Fri Aug 5 12:47:48 2016 +0200

    added compatibility function for VC14
---
 src/common/Makefile.am         |  1 +
 src/common/Makefile.mak        |  2 +-
 src/common/compat___iob_func.c | 22 ++++++++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 8990aec..df8c7dc 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -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
diff --git a/src/common/Makefile.mak b/src/common/Makefile.mak
index a1775cb..8227308 100644
--- a/src/common/Makefile.mak
+++ b/src/common/Makefile.mak
@@ -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
 
diff --git a/src/common/compat___iob_func.c b/src/common/compat___iob_func.c
new file mode 100644
index 0000000..86a1d39
--- /dev/null
+++ b/src/common/compat___iob_func.c
@@ -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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/opensc.git



More information about the pkg-opensc-commit mailing list