Hello Michele, Can you review the mail bellow and the attached patch? It would be nice to have the patch committed in SimCList.
Bye, 2010/11/30 Martin Paljak <[email protected]>: > Hello, > > On Fri, Nov 26, 2010 at 14:57, <[email protected]> wrote: >> Log Message: >> ----------- >> Update from SimCList version 1.5 >> http://mij.oltrelinux.com/devel/simclist/ > > At least the included patch is required to build with mingw, visual > studio might require even more. > Maybe it would make sense to suggest disabling the dumprestore > interface by default to simclist folks (#ifndef > SIMCLIST_NO_DUMPRESTORE -> #ifdef SIMCLIST_DUMPRESTORE) as storing and > loading a linked list does not seem like a common usage for linked > lists? > > Also, most code I've seen uses _WIN32 instead of WIN32 what is used in > simclist.c [1]? There's a similar thread on stackoverflow [2]. > > [1] > http://www.opensc-project.org/opensc/browser/trunk/src/common/simclist.c?rev=4882#L40 > [2] > http://stackoverflow.com/questions/662084/whats-the-difference-between-the-win32-and-win32-defines-in-c > > _______________________________________________ > opensc-devel mailing list > [email protected] > http://www.opensc-project.org/mailman/listinfo/opensc-devel > -- Dr. Ludovic Rousseau
From ab2cfb72a3d5d6415a88f0796f1f93d2c68fd6e1 Mon Sep 17 00:00:00 2001 From: Martin Paljak <[email protected]> Date: Tue, 30 Nov 2010 10:21:33 +0200 Subject: [PATCH] libopensc: fix building new simclist with mingw --- src/common/simclist.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/common/simclist.c b/src/common/simclist.c index f0dcff9..c543c9a 100644 --- a/src/common/simclist.c +++ b/src/common/simclist.c @@ -25,9 +25,15 @@ #include <string.h> #include <errno.h> /* for setting errno */ #include <sys/types.h> +#ifndef SIMCLIST_NO_DUMPRESTORE #include <sys/uio.h> /* for READ_ERRCHECK() and write() */ #include <fcntl.h> /* for open() etc */ +#endif +#if !defined(_WIN32) #include <arpa/inet.h> /* for htons() */ +#else +#include <winsock2.h> +#endif #include <unistd.h> #include <time.h> /* for time() for random seed */ #include <sys/time.h> /* for gettimeofday() */ @@ -178,6 +184,7 @@ static void *list_get_minmax(const list_t *restrict l, int versus); static inline struct list_entry_s *list_findpos(const list_t *restrict l, int posstart); +#ifndef SIMCLIST_NO_DUMPRESTORE /* write() decorated with error checking logic */ #define WRITE_ERRCHECK(fd, msgbuf, msglen) do { \ if (write(fd, msgbuf, msglen) < 0) return -1; \ @@ -189,6 +196,7 @@ static inline struct list_entry_s *list_findpos(const list_t *restrict l, int po return -1; \ } \ } while (0); +#endif /* * Random Number Generator -- 1.7.1
_______________________________________________ opensc-devel mailing list [email protected] http://www.opensc-project.org/mailman/listinfo/opensc-devel
