libcacard: stop including qemu-common.h
PATCH v2 1/1 libcacard: stop including qemu-common.h
From: Paolo Bonzini <[email protected]>
This is a small step towards making libcacard standalone.
---
v2: update vscclient.c too, use unistd.h on !WIN32 and getopt.h on *nix
libcacard/cac.c | 5 ++++- libcacard/card_7816.c | 4 +++- libcacard/event.c | 2 +- libcacard/vcard.c | 4 +++- libcacard/vcard_emul_nss.c | 2 +- libcacard/vreader.c | 4 +++- libcacard/vscclient.c | 8 +++++++- 7 files changed, 22 insertions(+), 7 deletions(-)
libcacard/cac.c +4 -1
@@ -5,7 +5,10 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> +#include <stdbool.h> #include "cac.h" #include "vcard.h"
libcacard/card_7816.c +3 -1
@@ -5,7 +5,9 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> #include "vcard.h" #include "vcard_emul.h"
libcacard/event.c +1 -1
@@ -5,7 +5,7 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" #include "vcard.h" #include "vreader.h"
libcacard/vcard.c +3 -1
@@ -5,7 +5,9 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> #include "vcard.h" #include "vcard_emul.h"
libcacard/vcard_emul_nss.c +1 -1
@@ -25,7 +25,7 @@#include <prthread.h> #include <secerr.h> -#include "qemu-common.h" +#include "glib-compat.h" #include "vcard.h" #include "card_7816t.h"
libcacard/vreader.c +3 -1
@@ -10,7 +10,9 @@#endif #define G_LOG_DOMAIN "libcacard" -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> #include "vcard.h" #include "vcard_emul.h"
libcacard/vscclient.c +7 -1
@@ -10,14 +10,20 @@* See the COPYING.LIB file in the top-level directory. */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #ifndef _WIN32#include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> +#include <unistd.h> #define closesocket (x) close(x) +#else +#include <getopt.h> #endif -#include "qemu-common.h" +#include "glib-compat.h" #include "vscard_common.h"
Signature · 1 line
2.1.4
Quoted 8 lines · Michael Tokarev
From: Paolo Bonzini <[email protected]>
This is a small step towards making libcacard standalone.
Signed-off-by Paolo Bonzini <[email protected]>Signed-off-by Michael Tokarev <[email protected]>---
v2: updatevscclient.ctoo, useunistd.hon !WIN32 andgetopt.hon *nix
Thanks very much Michael. The vscclient.c parts look good, you may want to add your changes before your S-o-b line.
Paolo
Quoted 124 lines
libcacard/cac.c | 5 ++++- libcacard/card_7816.c | 4 +++- libcacard/event.c | 2 +- libcacard/vcard.c | 4 +++- libcacard/vcard_emul_nss.c | 2 +- libcacard/vreader.c | 4 +++- libcacard/vscclient.c | 8 +++++++- 7 files changed, 22 insertions(+), 7 deletions(-)libcacard/cac.c +4
-1@@ -5,7 +5,10 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> +#include <stdbool.h> #include "cac.h" #include "vcard.h" libcacard/card_7816.c +3
-1@@ -5,7 +5,9 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> #include "vcard.h" #include "vcard_emul.h" libcacard/event.c +1
-1@@ -5,7 +5,7 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" #include "vcard.h" #include "vreader.h" libcacard/vcard.c +3
-1@@ -5,7 +5,9 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> #include "vcard.h" #include "vcard_emul.h" libcacard/vcard_emul_nss.c +1
-1@@ -25,7 +25,7 @@#include <prthread.h> #include <secerr.h> -#include "qemu-common.h" +#include "glib-compat.h" #include "vcard.h" #include "card_7816t.h" libcacard/vreader.c +3
-1@@ -10,7 +10,9 @@#endif #define G_LOG_DOMAIN "libcacard" -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> #include "vcard.h" #include "vcard_emul.h" libcacard/vscclient.c +7
-1@@ -10,14 +10,20 @@* See the COPYING.LIB file in the top-level directory. */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #ifndef _WIN32#include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> +#include <unistd.h> #define closesocket (x) close(x) +#else +#include <getopt.h> #endif -#include "qemu-common.h" +#include "glib-compat.h" #include "vscard_common.h"
Hello,
Quoted 3 lines · Michael Tokarev
From: Paolo Bonzini <[email protected]>
This is a small step towards making libcacard standalone.
on my system the removal of qemu-common.h inclusion broke compilation due to assert being used in glib-compat.h. A fix might be to include assert.h in glib-compat.h.
Thanks,
Laurent
Quoted 131 lines
Signed-off-by Paolo Bonzini <[email protected]>Signed-off-by Michael Tokarev <[email protected]>---
v2: updatevscclient.ctoo, useunistd.hon !WIN32 andgetopt.hon *nixlibcacard/cac.c | 5 ++++- libcacard/card_7816.c | 4 +++- libcacard/event.c | 2 +- libcacard/vcard.c | 4 +++- libcacard/vcard_emul_nss.c | 2 +- libcacard/vreader.c | 4 +++- libcacard/vscclient.c | 8 +++++++- 7 files changed, 22 insertions(+), 7 deletions(-)libcacard/cac.c +4
-1@@ -5,7 +5,10 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> +#include <stdbool.h> #include "cac.h" #include "vcard.h" libcacard/card_7816.c +3
-1@@ -5,7 +5,9 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> #include "vcard.h" #include "vcard_emul.h" libcacard/event.c +1
-1@@ -5,7 +5,7 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" #include "vcard.h" #include "vreader.h" libcacard/vcard.c +3
-1@@ -5,7 +5,9 @@* See the COPYING.LIB file in the top-level directory. */ -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> #include "vcard.h" #include "vcard_emul.h" libcacard/vcard_emul_nss.c +1
-1@@ -25,7 +25,7 @@#include <prthread.h> #include <secerr.h> -#include "qemu-common.h" +#include "glib-compat.h" #include "vcard.h" #include "card_7816t.h" libcacard/vreader.c +3
-1@@ -10,7 +10,9 @@#endif #define G_LOG_DOMAIN "libcacard" -#include "qemu-common.h" +#include "glib-compat.h" + +#include <string.h> #include "vcard.h" #include "vcard_emul.h" libcacard/vscclient.c +7
-2@@ -10,14 +10,20 @@* See the COPYING.LIB file in the top-level directory. */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #ifndef _WIN32#include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> +#include <unistd.h> #define closesocket (x) close(x) +#else +#include <getopt.h> #endif -#include "qemu-common.h" +#include "glib-compat.h" #include "vscard_common.h" --2.1.4
Quoted 9 lines · Laurent Desnogues
Hello,
Quoted 3 lines · Michael Tokarev
From: Paolo Bonzini <[email protected]>
This is a small step towards making libcacard standalone.
on my system the removal of
qemu-common.hinclusion broke compilation due to assert being used inglib-compat.h.
Interesting. What kind of build environment is that? I compile-tested on several platforms, all went fine.. ;)
Quoted 2 lines
A fix might be to include
assert.hinglib-compat.h.
I prefer s/assert/g_assert/ in glib-compat.h.
Thanks,
/mjt
Quoted 6 lines · Michael Tokarev
Quoted 5 lines · Laurent Desnogues
Hello,
Quoted 2 lines · Michael Tokarev
From: Paolo Bonzini <[email protected]>
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
This is a small step towards making libcacard standalone.
on my system the removal of
qemu-common.hinclusion broke compilation due to assert being used inglib-compat.h.Interesting. What kind of build environment is that? I compile-tested on several platforms, all went fine.. ;)
That's a CentOS 6.6 machine with glib2 2.28.8.
Quoted 4 lines
Quoted 2 lines
A fix might be to include
assert.hinglib-compat.h.I prefer s/assert/g_assert/ in
glib-compat.h.
That indeed looks better :-)
Thanks,
Laurent
Quoted 4 lines
Thanks,
/mjt