Skip to content
Browse files

Added 'extern C' guards to enable compilation in cross C/C++ environm…

…ents
  • Loading branch information...
1 parent 22a5af0 commit 82d86e16f545870cd5b42235f872de9d9d02b8ca @bacek committed Jun 4, 2012
View
8 kernel/atom.h
@@ -33,6 +33,10 @@
#include "atomtimer.h"
#include "atomport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Data types */
/* Forward declaration */
@@ -122,5 +126,9 @@ extern void archFirstThreadRestore(ATOM_TCB *new_tcb_ptr);
extern void atomTimerTick (void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __ATOM_H */
View
8 kernel/atommutex.h
@@ -29,6 +29,10 @@
#ifndef __ATOM_MUTEX_H
#define __ATOM_MUTEX_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct atom_mutex
{
ATOM_TCB * suspQ; /* Queue of threads suspended on this mutex */
@@ -41,4 +45,8 @@ extern uint8_t atomMutexDelete (ATOM_MUTEX *mutex);
extern uint8_t atomMutexGet (ATOM_MUTEX *mutex, int32_t timeout);
extern uint8_t atomMutexPut (ATOM_MUTEX *mutex);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __ATOM_MUTEX_H */
View
8 kernel/atomport-template.h
@@ -31,6 +31,10 @@
#define __ATOM_PORT_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Required number of system ticks per second (normally 100 for 10ms tick) */
#define SYSTEM_TICKS_PER_SEC 100
@@ -74,5 +78,9 @@
/* Uncomment to enable stack-checking */
/* #define ATOM_STACK_CHECKING */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __ATOM_PORT_H */
View
8 kernel/atomqueue.h
@@ -29,6 +29,10 @@
#ifndef __ATOM_QUEUE_H
#define __ATOM_QUEUE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct atom_queue
{
ATOM_TCB * putSuspQ; /* Queue of threads waiting to send */
@@ -46,4 +50,8 @@ extern uint8_t atomQueueDelete (ATOM_QUEUE *qptr);
extern uint8_t atomQueueGet (ATOM_QUEUE *qptr, int32_t timeout, uint8_t *msgptr);
extern uint8_t atomQueuePut (ATOM_QUEUE *qptr, int32_t timeout, uint8_t *msgptr);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __ATOM_QUEUE_H */
View
8 kernel/atomsem.h
@@ -30,6 +30,10 @@
#ifndef __ATOM_SEM_H
#define __ATOM_SEM_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct atom_sem
{
ATOM_TCB * suspQ; /* Queue of threads suspended on this semaphore */
@@ -42,4 +46,8 @@ extern uint8_t atomSemGet (ATOM_SEM *sem, int32_t timeout);
extern uint8_t atomSemPut (ATOM_SEM *sem);
extern uint8_t atomSemResetCount (ATOM_SEM *sem, uint8_t count);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __ATOM_SEM_H */
View
8 kernel/atomtimer.h
@@ -32,6 +32,10 @@
#include "atomport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Callback function prototype */
typedef void ( * TIMER_CB_FUNC ) ( POINTER cb_data ) ;
@@ -58,4 +62,8 @@ extern uint8_t atomTimerDelay (uint32_t ticks);
extern uint32_t atomTimeGet (void);
extern void atomTimeSet (uint32_t new_time);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __ATOM_TIMER_H */
View
8 ports/avr/atomport-private.h
@@ -30,10 +30,18 @@
#ifndef __ATOM_PORT_PRIVATE_H
#define __ATOM_PORT_PRIVATE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* CPU Frequency */
#define AVR_CPU_HZ 1000000
/* Function prototypes */
void avrInitSystemTickTimer ( void );
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __ATOM_PORT_PRIVATE_H */
View
8 ports/avr/atomport.h
@@ -40,6 +40,10 @@
/* Definition of NULL is available from stddef.h on this platform */
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Required number of system ticks per second (normally 100 for 10ms tick) */
#define SYSTEM_TICKS_PER_SEC 100
@@ -68,5 +72,9 @@
/* Uncomment to enable stack-checking */
/* #define ATOM_STACK_CHECKING */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __ATOM_PORT_H */
View
8 ports/avr/uart.h
@@ -13,6 +13,9 @@
#include "atom.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* Perform UART startup initialization.
@@ -23,3 +26,8 @@ int uart_init(uint32_t baudrate);
* Send one character to the UART.
*/
int uart_putchar(char c, FILE *stream);
+
+#ifdef __cplusplus
+}
+#endif
+

0 comments on commit 82d86e1

Please sign in to comment.
Something went wrong with that request. Please try again.