[CIFIX]add extern 'C' in C++ code

This commit is contained in:
liuwentan
2022-08-11 10:50:41 +08:00
parent 14703ec4b4
commit 85c28ff17e
12 changed files with 145 additions and 24 deletions

View File

@@ -8,7 +8,13 @@
***********************************************************************************************
*/
#pragma once
#ifndef _GLOBAL_VAR_H_
#define _GLOBAL_VAR_H_
#ifdef __cpluscplus
extern "C"
{
#endif
#include <limits.h>
#include <stdint.h>
@@ -86,4 +92,10 @@ extern struct stellar_engine g_engine_instance;
*
* @retval -1(failed), 0(success)
*/
int strncpy_safe(char *dst, const char *src, size_t dst_size);
int strncpy_safe(char *dst, const char *src, size_t dst_size);
#ifdef __cpluscplus
}
#endif
#endif /* _GLOBAL_VAR_H_ */

View File

@@ -8,7 +8,13 @@
***********************************************************************************************
*/
#pragma once
#ifndef _PIO_PACKET_QUEUE_H_
#define _PIO_PACKET_QUEUE_H_
#ifdef __cpluscplus
extern "C"
{
#endif
#include <stdint.h>
@@ -61,4 +67,10 @@ int packet_copy_data(uint8_t *ptr, const uint8_t *pkt_data, uint32_t pkt_len);
void pio_packet_enqueue(struct pio_packet_queue *, struct pio_packet *);
struct pio_packet *pio_packet_dequeue(struct pio_packet_queue *);
void release_pio_packet_queue(struct pio_packet_queue *);
void release_pio_packet_queue(struct pio_packet_queue *);
#ifdef __cpluscplus
}
#endif
#endif /* _PIO_PACKET_QUEUE_H_ */

View File

@@ -8,7 +8,13 @@
***********************************************************************************************
*/
#pragma once
#ifndef _TIME_HELPER_H_
#define _TIME_HELPER_H_
#ifdef __cpluscplus
extern "C"
{
#endif
#include <time.h>
#include <stdint.h>
@@ -19,4 +25,10 @@ int compare_timespec(struct timespec *left, struct timespec *right);
void copy_timespec(struct timespec *from, struct timespec *to);
uint64_t timespec_to_millisecond(const struct timespec* ts);
uint64_t timespec_to_millisecond(const struct timespec* ts);
#ifdef __cpluscplus
}
#endif
#endif /* _TIME_HELPER_H_ */

View File

@@ -8,10 +8,15 @@
***********************************************************************************************
*/
#pragma once
#ifndef _PIO_MARSIO_H_
#define _PIO_MARSIO_H_
#ifdef __cpluscplus
extern "C"
{
#endif
#include <stdint.h>
#include <marsio.h>
/**
@@ -166,4 +171,10 @@ char *pio_marsio_device_buff_mtod(struct stellar_packet *p);
uint32_t pio_marsio_device_buff_buflen(struct stellar_packet *p);
uint32_t pio_marsio_device_buff_datalen(struct stellar_packet *p);
uint32_t pio_marsio_device_buff_datalen(struct stellar_packet *p);
#ifdef __cpluscplus
}
#endif
#endif /* _PIO_MARSIO_H_ */

View File

@@ -8,7 +8,13 @@
***********************************************************************************************
*/
#pragma once
#ifndef _PACKET_IO_H_
#define _PACKET_IO_H_
#ifdef __cpluscplus
extern "C"
{
#endif
#include <stdint.h>
#include <limits.h>
@@ -169,4 +175,10 @@ uint32_t packet_io_buff_buflen(struct packet_io_device *pdev, struct stellar_pac
/**
* @brief get packet_io packet's data length
*/
uint32_t packet_io_buff_datalen(struct packet_io_device *pdev, struct stellar_packet *p);
uint32_t packet_io_buff_datalen(struct packet_io_device *pdev, struct stellar_packet *p);
#ifdef __cpluscplus
}
#endif
#endif /* _PIO_PCAP_LIVE_H_ */

View File

@@ -8,7 +8,13 @@
***********************************************************************************************
*/
#pragma once
#ifndef _PIO_PCAP_FILE_H_
#define _PIO_PCAP_FILE_H_
#ifdef __cpluscplus
extern "C"
{
#endif
#include <stdint.h>
#include <dirent.h>
@@ -137,4 +143,10 @@ char *pio_pcap_file_device_buff_mtod(struct stellar_packet *p);
uint32_t pio_pcap_file_device_buff_buflen(struct stellar_packet *p);
uint32_t pio_pcap_file_device_buff_datalen(struct stellar_packet *p);
uint32_t pio_pcap_file_device_buff_datalen(struct stellar_packet *p);
#ifdef __cpluscplus
}
#endif
#endif /* _PIO_PCAP_FILE_H_ */

View File

@@ -8,7 +8,13 @@
***********************************************************************************************
*/
#pragma once
#ifndef _PIO_PCAP_LIVE_H_
#define _PIO_PCAP_LIVE_H_
#ifdef __cpluscplus
extern "C"
{
#endif
#include <stdint.h>
#include <pcap/pcap.h>
@@ -99,4 +105,10 @@ char *pio_pcap_live_device_buff_mtod(struct stellar_packet *p);
uint32_t pio_pcap_live_device_buff_buflen(struct stellar_packet *p);
uint32_t pio_pcap_live_device_buff_datalen(struct stellar_packet *p);
uint32_t pio_pcap_live_device_buff_datalen(struct stellar_packet *p);
#ifdef __cpluscplus
}
#endif
#endif /* _PIO_PCAP_LIVE_H_ */