Skip to contentSkip to conversation

libcacard: stop including qemu-common.h

PATCH In review Paolo Bonzini 2 participants 6 messages Apr 27, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libcacard: stop including qemu-common.h

This is a small step towards making libcacard standalone.

---
 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      | 2 +-
 7 files changed, 16 insertions(+), 7 deletions(-)
libcacard/cac.c +4 -1
index f38fdce..2a7d1a4 100644
@@ -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
index 814fa16..0c22dc4 100644
@@ -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
index 4c551e4..10ef928 100644
@@ -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
index d140a8e..b4aecee 100644
@@ -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
index 950edee..5fde0eb 100644
@@ -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
index 0315dd8..562da44 100644
@@ -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 +1 -1
index fa6041d..8c6fb82 100644
@@ -17,7 +17,7 @@
 #define closesocket(x) close(x)
 #endif
 
-#include "qemu-common.h"
+#include "glib-compat.h"
 
 #include "vscard_common.h"
 
Signature · 1 line
2.3.5
#1 lore raw
Quoted 1 line · Paolo Bonzini

This is a small step towards making libcacard standalone.

No, this does not build, it complains about printf everywhere and some other things, like atoi. I'll try to make it better, and maybe to omit glib-compat inclusion too from some places.

Thanks,

/mjt

#2 lore raw
Quoted 4 lines · Michael Tokarev
Quoted 1 line

This is a small step towards making libcacard standalone.

No, this does not build, it complains about printf everywhere and some other things, like atoi. I'll try to make it better, and maybe to omit glib-compat inclusion too from some places.

Weird, it builds here. Must be a different glib.

Paolo

#3 lore raw
Quoted 7 lines · Paolo Bonzini
Quoted 4 lines · Michael Tokarev
Quoted 1 line

This is a small step towards making libcacard standalone.

No, this does not build, it complains about printf everywhere and some other things, like atoi. I'll try to make it better, and maybe to omit glib-compat inclusion too from some places.

Weird, it builds here. Must be a different glib.

All the missing includes are in vscclient.c.

/mjt

#4 lore raw

27.04.2015 16:01, Michael Tokarev пишет:

Quoted 10 lines
Quoted 7 lines · Paolo Bonzini
Quoted 4 lines · Michael Tokarev
Quoted 1 line

This is a small step towards making libcacard standalone.

No, this does not build, it complains about printf everywhere and some other things, like atoi. I'll try to make it better, and maybe to omit glib-compat inclusion too from some places.

Weird, it builds here. Must be a different glib.

All the missing includes are in vscclient.c.

stdio.h for printf
string.h for various strcmp etc
stdlib.h for atoi
unistd.h (on *nix) for getopt

It looks like you didn't build vscclient.

#5 lore raw
Quoted 8 lines · Michael Tokarev
Quoted 2 lines
Quoted 2 lines

All the missing includes are in vscclient.c.

stdio.h for printf
string.h for various strcmp etc
stdlib.h for atoi
unistd.h (on *nix) for getopt

It looks like you didn't build vscclient.

/me holds myself guilty.

Paolo