C99 compiler is a requirement so we don't need --enable-std99 anymore.

Define _XOPEN_SOURCE 600 using config.h
This commit is contained in:
Romuald Conty 2010-01-12 17:58:13 +00:00
parent 0b720d30cd
commit e4ca9245ec
4 changed files with 36 additions and 33 deletions

View file

@ -33,6 +33,7 @@ AC_PATH_PROG(PKG_CONFIG, pkg-config)
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_STDBOOL AC_HEADER_STDBOOL
AC_CHECK_HEADERS([stdio.h stdlib.h stdint.h stddef.h stdbool.h]) 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 # Checks for types
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
@ -186,20 +187,11 @@ fi
AC_SUBST(PKG_CONFIG_REQUIRES) AC_SUBST(PKG_CONFIG_REQUIRES)
# Set C standard to C99 # Defines and C flags
# C99 standard support (default: yes) CFLAGS="$CFLAGS -std=c99"
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) # Workarounds for libusb in c99
AC_MSG_RESULT($enable_std_c99) CFLAGS="$CFLAGS -Du_int8_t=uint8_t -Du_int16_t=uint16_t"
if test x"$enable_std_c99" != "xno"
then
CFLAGS="$CFLAGS -std=c99"
# Workarounds for libusb in c99
CFLAGS="$CFLAGS -Du_int8_t=uint8_t -Du_int16_t=uint16_t"
fi
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile

View file

@ -1,4 +1,4 @@
/** /*-
* Public platform independent Near Field Communication (NFC) library * Public platform independent Near Field Communication (NFC) library
* *
* Copyright (C) 2009, Roel Verdult * Copyright (C) 2009, Roel Verdult
@ -15,15 +15,21 @@
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/> * along with this program. If not, see <http://www.gnu.org/licenses/>
* */
*
/**
* @file drivers.h * @file drivers.h
* @brief * @brief Supported drivers header
*/ */
#ifndef __NFC_DRIVERS_H__ #ifndef __NFC_DRIVERS_H__
#define __NFC_DRIVERS_H__ #define __NFC_DRIVERS_H__
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
#include <nfc/nfc-types.h> #include <nfc/nfc-types.h>
#ifdef HAVE_PCSC_LITE #ifdef HAVE_PCSC_LITE

View file

@ -1,4 +1,4 @@
/** /*-
* Public platform independent Near Field Communication (NFC) library * Public platform independent Near Field Communication (NFC) library
* *
* Copyright (C) 2009, Roel Verdult * Copyright (C) 2009, Roel Verdult
@ -15,20 +15,24 @@
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/> * along with this program. If not, see <http://www.gnu.org/licenses/>
*
*
* @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 <stdio.h> #include <stdio.h>
#include "arygon.h" #include "arygon.h"
#include <nfc/nfc-messages.h> #include <nfc/nfc-messages.h>
#include "../drivers.h"
#include "../bitutils.h"
// Bus // Bus
#include "../buses/uart.h" #include "../buses/uart.h"

View file

@ -1,4 +1,4 @@
/** /*-
* Public platform independent Near Field Communication (NFC) library * Public platform independent Near Field Communication (NFC) library
* *
* Copyright (C) 2009, Roel Verdult * Copyright (C) 2009, Roel Verdult
@ -15,12 +15,15 @@
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/> * along with this program. If not, see <http://www.gnu.org/licenses/>
*
*
* @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 <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -28,8 +31,6 @@
#include <nfc/nfc-messages.h> #include <nfc/nfc-messages.h>
#include "../drivers.h"
#include "../bitutils.h"
// Bus // Bus
#include "uart.h" #include "uart.h"