diff --git a/include/FreeRTOS_POSIX/errno.h b/include/FreeRTOS_POSIX/errno.h index 136e04b..5ca3a32 100755 --- a/include/FreeRTOS_POSIX/errno.h +++ b/include/FreeRTOS_POSIX/errno.h @@ -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_ */ diff --git a/include/FreeRTOS_POSIX/fcntl.h b/include/FreeRTOS_POSIX/fcntl.h index 1e921ce..e1b41d4 100755 --- a/include/FreeRTOS_POSIX/fcntl.h +++ b/include/FreeRTOS_POSIX/fcntl.h @@ -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_ */ diff --git a/include/FreeRTOS_POSIX/mqueue.h b/include/FreeRTOS_POSIX/mqueue.h index 7cbf01c..4a2b164 100755 --- a/include/FreeRTOS_POSIX/mqueue.h +++ b/include/FreeRTOS_POSIX/mqueue.h @@ -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_ */ diff --git a/include/FreeRTOS_POSIX/pthread.h b/include/FreeRTOS_POSIX/pthread.h index 77f949a..f38dccf 100755 --- a/include/FreeRTOS_POSIX/pthread.h +++ b/include/FreeRTOS_POSIX/pthread.h @@ -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_ */ diff --git a/include/FreeRTOS_POSIX/sched.h b/include/FreeRTOS_POSIX/sched.h index 5a72c44..b6e79e9 100755 --- a/include/FreeRTOS_POSIX/sched.h +++ b/include/FreeRTOS_POSIX/sched.h @@ -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_ */ diff --git a/include/FreeRTOS_POSIX/semaphore.h b/include/FreeRTOS_POSIX/semaphore.h index fa1da91..661809a 100755 --- a/include/FreeRTOS_POSIX/semaphore.h +++ b/include/FreeRTOS_POSIX/semaphore.h @@ -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_ */ diff --git a/include/FreeRTOS_POSIX/signal.h b/include/FreeRTOS_POSIX/signal.h index 8f9cc6d..d99aa4a 100755 --- a/include/FreeRTOS_POSIX/signal.h +++ b/include/FreeRTOS_POSIX/signal.h @@ -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_ */ diff --git a/include/FreeRTOS_POSIX/sys/types.h b/include/FreeRTOS_POSIX/sys/types.h index 9cb3428..4a5e922 100755 --- a/include/FreeRTOS_POSIX/sys/types.h +++ b/include/FreeRTOS_POSIX/sys/types.h @@ -33,6 +33,10 @@ #ifndef _FREERTOS_POSIX_TYPES_H_ #define _FREERTOS_POSIX_TYPES_H_ +#ifdef __cplusplus +extern "C" { +#endif + /* C standard library includes. */ #include @@ -188,4 +192,8 @@ typedef void * pthread_barrierattr_t; typedef long int off_t; #endif +#ifdef __cplusplus +} +#endif + #endif /* ifndef _FREERTOS_POSIX_TYPES_H_ */ diff --git a/include/FreeRTOS_POSIX/time.h b/include/FreeRTOS_POSIX/time.h index d04de0f..d28336d 100755 --- a/include/FreeRTOS_POSIX/time.h +++ b/include/FreeRTOS_POSIX/time.h @@ -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_ */ diff --git a/include/FreeRTOS_POSIX/unistd.h b/include/FreeRTOS_POSIX/unistd.h index 3b8af22..a70a145 100755 --- a/include/FreeRTOS_POSIX/unistd.h +++ b/include/FreeRTOS_POSIX/unistd.h @@ -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_ */ diff --git a/include/FreeRTOS_POSIX/utils.h b/include/FreeRTOS_POSIX/utils.h index c893a95..60306e6 100755 --- a/include/FreeRTOS_POSIX/utils.h +++ b/include/FreeRTOS_POSIX/utils.h @@ -31,6 +31,10 @@ #ifndef _FREERTOS_POSIX_UTILS_ #define _FREERTOS_POSIX_UTILS_ +#ifdef __cplusplus +extern "C" { +#endif + /* C standard library includes. */ #include #include @@ -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_ */