[Pcsclite-cvs-commit] r6924 - trunk/Drivers/ccid/src/openct

ludovic.rousseau at free.fr ludovic.rousseau at free.fr
Tue Jun 17 09:14:49 UTC 2014


Author: rousseau
Date: 2014-06-17 09:14:49 +0000 (Tue, 17 Jun 2014)
New Revision: 6924

Modified:
   trunk/Drivers/ccid/src/openct/buffer.c
   trunk/Drivers/ccid/src/openct/buffer.h
   trunk/Drivers/ccid/src/openct/checksum.h
   trunk/Drivers/ccid/src/openct/proto-t1.c
   trunk/Drivers/ccid/src/openct/proto-t1.h
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/openct/buffer.c
===================================================================
--- trunk/Drivers/ccid/src/openct/buffer.c	2014-06-17 08:56:51 UTC (rev 6923)
+++ trunk/Drivers/ccid/src/openct/buffer.c	2014-06-17 09:14:49 UTC (rev 6924)
@@ -4,12 +4,12 @@
  * Copyright (C) 2003, Olaf Kirch <okir at suse.de>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h>
 #endif
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
+
 #include <openct/buffer.h>
 
 void

Modified: trunk/Drivers/ccid/src/openct/buffer.h
===================================================================
--- trunk/Drivers/ccid/src/openct/buffer.h	2014-06-17 08:56:51 UTC (rev 6923)
+++ trunk/Drivers/ccid/src/openct/buffer.h	2014-06-17 09:14:49 UTC (rev 6924)
@@ -11,7 +11,9 @@
 extern "C" {
 #endif
 
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
 
 typedef struct ct_buf {
 	unsigned char *		base;

Modified: trunk/Drivers/ccid/src/openct/checksum.h
===================================================================
--- trunk/Drivers/ccid/src/openct/checksum.h	2014-06-17 08:56:51 UTC (rev 6923)
+++ trunk/Drivers/ccid/src/openct/checksum.h	2014-06-17 09:14:49 UTC (rev 6924)
@@ -26,7 +26,9 @@
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 extern unsigned int	csum_lrc_compute(const uint8_t *, size_t, unsigned char *);
 extern unsigned int	csum_crc_compute(const uint8_t *, size_t, unsigned char *);

Modified: trunk/Drivers/ccid/src/openct/proto-t1.c
===================================================================
--- trunk/Drivers/ccid/src/openct/proto-t1.c	2014-06-17 08:56:51 UTC (rev 6923)
+++ trunk/Drivers/ccid/src/openct/proto-t1.c	2014-06-17 09:14:49 UTC (rev 6924)
@@ -7,6 +7,8 @@
  * Copyright (C) 2004 Ludovic Rousseau <ludovic.rousseau at free.fr>
  */
 
+#include "config.h"
+
 #include <pcsclite.h>
 #include <ifdhandler.h>
 #include "commands.h"
@@ -17,7 +19,9 @@
 
 #include "ccid.h"
 
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
 
 /* I block */
 #define T1_I_SEQ_SHIFT		6

Modified: trunk/Drivers/ccid/src/openct/proto-t1.h
===================================================================
--- trunk/Drivers/ccid/src/openct/proto-t1.h	2014-06-17 08:56:51 UTC (rev 6923)
+++ trunk/Drivers/ccid/src/openct/proto-t1.h	2014-06-17 09:14:49 UTC (rev 6924)
@@ -26,7 +26,6 @@
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
-#include <unistd.h>
 
 #include "buffer.h"
 




More information about the Pcsclite-cvs-commit mailing list