Fix name mangling when using a C++ compiler (#7)

This commit is contained in:
Anes Belfodil 2020-09-25 14:37:09 -04:00 committed by GitHub
parent 52b1a0f80d
commit 0c6cec978c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 88 additions and 0 deletions

View File

@ -36,6 +36,10 @@
#ifndef _FREERTOS_POSIX_ERRNO_H_
#define _FREERTOS_POSIX_ERRNO_H_
#ifdef __cplusplus
extern "C" {
#endif
/* Undefine all errnos to avoid redefinition errors with system errnos. */
#undef EPERM
#undef ENOENT
@ -92,4 +96,8 @@
#endif
/**@} */
#ifdef __cplusplus
}
#endif
#endif /* ifndef _FREERTOS_POSIX_ERRNO_H_ */

View File

@ -33,6 +33,10 @@
#ifndef _FREERTOS_POSIX_FCNTL_H_
#define _FREERTOS_POSIX_FCNTL_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name File creation flags for use in the oflag value to open() and openat().
*/
@ -76,4 +80,8 @@
#define O_WRONLY 0x8000 /**< Open for writing only. */
/**@} */
#ifdef __cplusplus
}
#endif
#endif /* ifndef _FREERTOS_POSIX_FCNTL_H_ */

View File

@ -33,6 +33,10 @@
#ifndef _FREERTOS_POSIX_MQUEUE_H_
#define _FREERTOS_POSIX_MQUEUE_H_
#ifdef __cplusplus
extern "C" {
#endif
/* FreeRTOS+POSIX includes. */
#include "FreeRTOS_POSIX/time.h"
@ -247,4 +251,8 @@ int mq_timedsend( mqd_t mqdes,
*/
int mq_unlink( const char * name );
#ifdef __cplusplus
}
#endif
#endif /* ifndef _FREERTOS_POSIX_MQUEUE_H_ */

View File

@ -33,6 +33,10 @@
#ifndef _FREERTOS_POSIX_PTHREAD_H_
#define _FREERTOS_POSIX_PTHREAD_H_
#ifdef __cplusplus
extern "C" {
#endif
/* FreeRTOS+POSIX includes. POSIX states that this header shall make symbols
* defined in sched.h and time.h visible. */
#include "FreeRTOS_POSIX/sched.h"
@ -498,4 +502,8 @@ int pthread_setschedparam( pthread_t thread,
int policy,
const struct sched_param * param );
#ifdef __cplusplus
}
#endif
#endif /* _FREERTOS_POSIX_PTHREAD_H_ */

View File

@ -33,6 +33,10 @@
#ifndef _FREERTOS_POSIX_SCHED_H_
#define _FREERTOS_POSIX_SCHED_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Scheduling Policies
*/
@ -81,4 +85,8 @@ int sched_get_priority_min( int policy );
*/
int sched_yield( void );
#ifdef __cplusplus
}
#endif
#endif /* ifndef _FREERTOS_POSIX_SCHED_H_ */

View File

@ -37,6 +37,10 @@
#include "FreeRTOS_POSIX/time.h"
#include "FreeRTOS_POSIX_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Semaphore type.
*/
@ -140,4 +144,8 @@ int sem_trywait( sem_t * sem );
*/
int sem_wait( sem_t * sem );
#ifdef __cplusplus
}
#endif
#endif /* ifndef _FREERTOS_POSIX_SEMAPHORE_H_ */

View File

@ -37,6 +37,10 @@
#ifndef _FREERTOS_POSIX_SIGNAL_H_
#define _FREERTOS_POSIX_SIGNAL_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Values of sigev_notify.
*/
@ -67,4 +71,8 @@ struct sigevent
pthread_attr_t * sigev_notify_attributes; /**< Notification attributes. */
};
#ifdef __cplusplus
}
#endif
#endif /* ifndef _FREERTOS_POSIX_SIGNAL_H_ */

View File

@ -33,6 +33,10 @@
#ifndef _FREERTOS_POSIX_TYPES_H_
#define _FREERTOS_POSIX_TYPES_H_
#ifdef __cplusplus
extern "C" {
#endif
/* C standard library includes. */
#include <stdint.h>
@ -188,4 +192,8 @@ typedef void * pthread_barrierattr_t;
typedef long int off_t;
#endif
#ifdef __cplusplus
}
#endif
#endif /* ifndef _FREERTOS_POSIX_TYPES_H_ */

View File

@ -33,6 +33,10 @@
#ifndef _FREERTOS_POSIX_TIME_H_
#define _FREERTOS_POSIX_TIME_H_
#ifdef __cplusplus
extern "C" {
#endif
/* FreeRTOS+POSIX includes. */
#include "FreeRTOS_POSIX/sys/types.h"
#include "FreeRTOS_POSIX/signal.h"
@ -255,4 +259,8 @@ int timer_settime( timer_t timerid,
const struct itimerspec * value,
struct itimerspec * ovalue );
#ifdef __cplusplus
}
#endif
#endif /* ifndef _FREERTOS_POSIX_TIME_H_ */

View File

@ -33,6 +33,10 @@
#ifndef _FREERTOS_POSIX_UNISTD_H_
#define _FREERTOS_POSIX_UNISTD_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "FreeRTOS_POSIX/sys/types.h"
/**
@ -58,4 +62,8 @@ unsigned sleep( unsigned seconds );
*/
int usleep( useconds_t usec );
#ifdef __cplusplus
}
#endif
#endif /* ifndef _FREERTOS_POSIX_UNISTD_H_ */

View File

@ -31,6 +31,10 @@
#ifndef _FREERTOS_POSIX_UTILS_
#define _FREERTOS_POSIX_UTILS_
#ifdef __cplusplus
extern "C" {
#endif
/* C standard library includes. */
#include <stdbool.h>
#include <stdint.h>
@ -152,4 +156,8 @@ int UTILS_TimespecCompare( const struct timespec * const x,
*/
bool UTILS_ValidateTimespec( const struct timespec * const pxTimespec );
#ifdef __cplusplus
}
#endif
#endif /* ifndef _FREERTOS_POSIX_UTILS_ */