added compatibility to mingw

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@408 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2011-02-06 20:26:37 +00:00
parent 8bb7b592d6
commit 3674c41f66
3 changed files with 29 additions and 5 deletions

View File

@@ -26,7 +26,25 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#ifndef HAVE_GETLINE
static ssize_t getline(char **lineptr, size_t *n, FILE *stream)
{
if (!lineptr)
return -1;
char *p = realloc(*lineptr, SC_MAX_EXT_APDU_BUFFER_SIZE*3);
if (!p)
return -1;
*lineptr = p;
if (fgets(p, SC_MAX_EXT_APDU_BUFFER_SIZE*3, stream) == NULL)
return -1;
return strlen(p);
}
#endif
static int verbose = 0;
static int doinfo = 0;