diff --git a/configure.ac b/configure.ac index c6c23fd..35f4c17 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,7 @@ AC_PATH_PROG(PKG_CONFIG, pkg-config) AC_HEADER_STDC AC_HEADER_STDBOOL AC_CHECK_HEADERS([stdio.h stdlib.h stdint.h stddef.h stdbool.h]) +AC_CHECK_FUNCS(strdup, [AC_DEFINE([_XOPEN_SOURCE], [600], [Enable POSIX extensions if present])]) # Checks for types AC_TYPE_SIZE_T @@ -186,20 +187,11 @@ fi AC_SUBST(PKG_CONFIG_REQUIRES) -# Set C standard to C99 -# C99 standard support (default: yes) -AC_ARG_ENABLE([std-c99],AS_HELP_STRING([--disable-std-c99],[Disable C99 standard when compiling]),[enable_std_c99=$enableval],[enable_std_c99="yes"]) - -AC_MSG_CHECKING(for C99 support) -AC_MSG_RESULT($enable_std_c99) - -if test x"$enable_std_c99" != "xno" -then - CFLAGS="$CFLAGS -std=c99" +# Defines and C flags +CFLAGS="$CFLAGS -std=c99" - # Workarounds for libusb in c99 - CFLAGS="$CFLAGS -Du_int8_t=uint8_t -Du_int16_t=uint16_t" -fi +# Workarounds for libusb in c99 +CFLAGS="$CFLAGS -Du_int8_t=uint8_t -Du_int16_t=uint16_t" AC_CONFIG_FILES([ Makefile diff --git a/src/lib/drivers.h b/src/lib/drivers.h index 6d63165..8a04ec6 100644 --- a/src/lib/drivers.h +++ b/src/lib/drivers.h @@ -1,4 +1,4 @@ -/** +/*- * Public platform independent Near Field Communication (NFC) library * * Copyright (C) 2009, Roel Verdult @@ -15,15 +15,21 @@ * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see - * - * + */ + +/** * @file drivers.h - * @brief + * @brief Supported drivers header */ #ifndef __NFC_DRIVERS_H__ #define __NFC_DRIVERS_H__ +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif /* HAVE_CONFIG_H */ + + #include #ifdef HAVE_PCSC_LITE diff --git a/src/lib/drivers/arygon.c b/src/lib/drivers/arygon.c index 2722e78..788489b 100644 --- a/src/lib/drivers/arygon.c +++ b/src/lib/drivers/arygon.c @@ -1,4 +1,4 @@ -/** +/*- * Public platform independent Near Field Communication (NFC) library * * Copyright (C) 2009, Roel Verdult @@ -15,20 +15,24 @@ * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see - * - * - * @file arygon.c - * @brief */ -#define _XOPEN_SOURCE 500 + +/** + * @file arygon.c + * @brief ARYGON readers driver + * + * This driver can handle ARYGON readers that use UART as bus. + * UART connection can be direct (host<->arygon_uc) or could be provided by internal USB to serial interface (e.g. host<->ftdi_chip<->arygon_uc) + */ +#include "../drivers.h" +#include "../bitutils.h" + #include #include "arygon.h" #include -#include "../drivers.h" -#include "../bitutils.h" // Bus #include "../buses/uart.h" diff --git a/src/lib/drivers/pn532_uart.c b/src/lib/drivers/pn532_uart.c index f18e40f..2d056af 100644 --- a/src/lib/drivers/pn532_uart.c +++ b/src/lib/drivers/pn532_uart.c @@ -1,4 +1,4 @@ -/** +/*- * Public platform independent Near Field Communication (NFC) library * * Copyright (C) 2009, Roel Verdult @@ -15,12 +15,15 @@ * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see - * - * - * @file pn532_uart.c - * @brief */ -#define _XOPEN_SOURCE 600 + +/** + * @file pn532_uart.c + * @brief PN532 driver using UART bus (UART, RS232, etc.) + */ +#include "../drivers.h" +#include "../bitutils.h" + #include #include @@ -28,8 +31,6 @@ #include -#include "../drivers.h" -#include "../bitutils.h" // Bus #include "uart.h"