[Pcsclite-cvs-commit] r6928 - trunk/Drivers/ccid/src

ludovic.rousseau at free.fr ludovic.rousseau at free.fr
Tue Jun 17 09:43:47 UTC 2014


Author: rousseau
Date: 2014-06-17 09:43:47 +0000 (Tue, 17 Jun 2014)
New Revision: 6928

Modified:
   trunk/Drivers/ccid/src/commands.c
   trunk/Drivers/ccid/src/ifdhandler.c
Log:
Use #ifdef HAVE_* before including .h files

Some systems do not have C header files, like UEFI for example.


Modified: trunk/Drivers/ccid/src/commands.c
===================================================================
--- trunk/Drivers/ccid/src/commands.c	2014-06-17 09:32:22 UTC (rev 6927)
+++ trunk/Drivers/ccid/src/commands.c	2014-06-17 09:43:47 UTC (rev 6928)
@@ -22,16 +22,25 @@
  * $Id$
  */
 
+#include "config.h"
+
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#ifdef HAVE_ERRNO_H
 #include <errno.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include <pcsclite.h>
 #include <ifdhandler.h>
 #include <reader.h>
 
-#include "config.h"
 #include "misc.h"
 #include "commands.h"
 #include "openct/proto-t1.h"

Modified: trunk/Drivers/ccid/src/ifdhandler.c
===================================================================
--- trunk/Drivers/ccid/src/ifdhandler.c	2014-06-17 09:32:22 UTC (rev 6927)
+++ trunk/Drivers/ccid/src/ifdhandler.c	2014-06-17 09:43:47 UTC (rev 6928)
@@ -19,13 +19,21 @@
 
 /* $Id$ */
 
+#include "config.h"
+
+#ifdef HAVE_STDIO_H
 #include <stdio.h>
+#endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
-#include <arpa/inet.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
-#include "config.h"
 #include "misc.h"
 #include <pcsclite.h>
 #include <ifdhandler.h>




More information about the Pcsclite-cvs-commit mailing list