all: add support for building with C++

Update header files to support using the library with C++.

Signed-off-by: Ryan Barnett <ryan.barnett@rockwellcollins.com>
Signed-off-by: Vanya A. Sergeev <v@sergeev.io>
This commit is contained in:
Ryan Barnett
2018-01-30 09:49:04 -06:00
committed by Vanya A. Sergeev
parent 304faf4f28
commit 82ebb4f6cf
6 changed files with 48 additions and 0 deletions

View File

@@ -7,6 +7,10 @@
#ifndef _PERIPHERY_GPIO_H
#define _PERIPHERY_GPIO_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdbool.h>
@@ -72,5 +76,9 @@ int gpio_tostring(gpio_t *gpio, char *str, size_t len);
int gpio_errno(gpio_t *gpio);
const char *gpio_errmsg(gpio_t *gpio);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -7,6 +7,10 @@
#ifndef _PERIPHERY_I2C_H
#define _PERIPHERY_I2C_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
#include <limits.h>
@@ -63,5 +67,9 @@ const char *i2c_errmsg(i2c_t *i2c);
};
*/
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -7,6 +7,10 @@
#ifndef _PERIPHERY_MMIO_H
#define _PERIPHERY_MMIO_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
@@ -52,5 +56,9 @@ int mmio_tostring(mmio_t *mmio, char *str, size_t len);
int mmio_errno(mmio_t *mmio);
const char *mmio_errmsg(mmio_t *mmio);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -7,6 +7,10 @@
#ifndef _PERIPHERY_SERIAL_H
#define _PERIPHERY_SERIAL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
@@ -73,5 +77,9 @@ int serial_tostring(serial_t *serial, char *str, size_t len);
int serial_errno(serial_t *serial);
const char *serial_errmsg(serial_t *serial);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -7,6 +7,10 @@
#ifndef _PERIPHERY_SPI_H
#define _PERIPHERY_SPI_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
@@ -64,5 +68,9 @@ int spi_tostring(spi_t *spi, char *str, size_t len);
int spi_errno(spi_t *spi);
const char *spi_errmsg(spi_t *spi);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -7,6 +7,10 @@
#ifndef _PERIPHERY_VERSION_H
#define _PERIPHERY_VERSION_H
#ifdef __cplusplus
extern "C" {
#endif
#define PERIPHERY_VERSION_MAJOR 1
#define PERIPHERY_VERSION_MINOR 1
#define PERIPHERY_VERSION_PATCH 1
@@ -26,5 +30,9 @@ const char *periphery_version(void);
const periphery_version_t *periphery_version_info(void);
#ifdef __cplusplus
}
#endif
#endif