diff --git a/core/include/arch/atomic_arch.h b/core/include/arch/atomic_arch.h index 5060da4b68..bbfcbc1c5f 100644 --- a/core/include/arch/atomic_arch.h +++ b/core/include/arch/atomic_arch.h @@ -19,6 +19,10 @@ #ifndef __ATOMIC_ARCH_H #define __ATOMIC_ARCH_H +#ifdef __cplusplus + extern "C" { +#endif + /** * @brief Define mappings between arch and internal interfaces * @@ -41,6 +45,9 @@ */ unsigned int atomic_arch_set_return(unsigned int *to_set, unsigned int value); +#ifdef __cplusplus +} +#endif #endif /* __ATOMIC_ARCH_H */ /** @} */ diff --git a/core/include/arch/hwtimer_arch.h b/core/include/arch/hwtimer_arch.h index 9d76531f65..7e352ec757 100644 --- a/core/include/arch/hwtimer_arch.h +++ b/core/include/arch/hwtimer_arch.h @@ -22,6 +22,10 @@ #ifndef HWTIMER_ARCH_H_ #define HWTIMER_ARCH_H_ +#ifdef __cplusplus + extern "C" { +#endif + #include /** @@ -73,6 +77,9 @@ void hwtimer_arch_unset(short timer); */ unsigned long hwtimer_arch_now(void); +#ifdef __cplusplus +} +#endif #endif /* HWTIMER_ARCH_H_ */ /** @} */ diff --git a/core/include/arch/io_arch.h b/core/include/arch/io_arch.h index e795f1f800..1e3cf98db5 100644 --- a/core/include/arch/io_arch.h +++ b/core/include/arch/io_arch.h @@ -19,6 +19,10 @@ #ifndef __IO_ARCH_H #define __IO_ARCH_H +#ifdef __cplusplus + extern "C" { +#endif + /** * @brief Define mapping between kernel internal and arch interfaces * @@ -44,6 +48,9 @@ */ int io_arch_puts(char *data, int count); +#ifdef __cplusplus +} +#endif #endif /* __IO_ARCH_H */ /** @} */ diff --git a/core/include/arch/irq_arch.h b/core/include/arch/irq_arch.h index f4ac405bf9..554fb2ce59 100644 --- a/core/include/arch/irq_arch.h +++ b/core/include/arch/irq_arch.h @@ -22,6 +22,10 @@ #ifndef __IRQ_ARCH_H #define __IRQ_ARCH_H +#ifdef __cplusplus + extern "C" { +#endif + /** * @name Define mapping between kernel internal and arch interfaces * @@ -66,6 +70,9 @@ void irq_arch_restore(unsigned int state); */ int irq_arch_in(void); +#ifdef __cplusplus +} +#endif #endif /* __IRQ_ARCH_H */ /** @} */ diff --git a/core/include/arch/lpm_arch.h b/core/include/arch/lpm_arch.h index 7f2dd97957..fd472c4421 100644 --- a/core/include/arch/lpm_arch.h +++ b/core/include/arch/lpm_arch.h @@ -22,6 +22,10 @@ #ifndef __LPM_ARCH_H #define __LPM_ARCH_H +#ifdef __cplusplus + extern "C" { +#endif + /** * @brief Define the mapping between the architecture independent interfaces and the kernel internal interfaces @@ -88,6 +92,9 @@ void lpm_arch_begin_awake(void); */ void lpm_arch_end_awake(void); +#ifdef __cplusplus +} +#endif #endif /* __LPM_ARCH_H */ /** @} */ diff --git a/core/include/arch/reboot_arch.h b/core/include/arch/reboot_arch.h index 698f51acc8..ba7274accc 100644 --- a/core/include/arch/reboot_arch.h +++ b/core/include/arch/reboot_arch.h @@ -20,6 +20,10 @@ #ifndef __REBOOT_ARCH_H #define __REBOOT_ARCH_H +#ifdef __cplusplus + extern "C" { +#endif + /** * @brief Reboot the system * @@ -30,6 +34,9 @@ */ int reboot_arch(int mode); +#ifdef __cplusplus +} +#endif #endif /* __REBOOT_ARCH_H */ /** @} */ diff --git a/core/include/arch/thread_arch.h b/core/include/arch/thread_arch.h index 0228b79133..d41615b591 100644 --- a/core/include/arch/thread_arch.h +++ b/core/include/arch/thread_arch.h @@ -19,6 +19,10 @@ #ifndef __THREAD_ARCH_H #define __THREAD_ARCH_H +#ifdef __cplusplus + extern "C" { +#endif + #include "attributes.h" /** @@ -65,6 +69,9 @@ void thread_arch_start_threading(void) NORETURN; */ void thread_arch_yield(void); +#ifdef __cplusplus +} +#endif #endif /* __THREAD_ARCH_H */ /** @} */ diff --git a/core/include/atomic.h b/core/include/atomic.h index 3ac803b983..07fa631c1c 100644 --- a/core/include/atomic.h +++ b/core/include/atomic.h @@ -19,6 +19,10 @@ #ifndef _ATOMIC_H #define _ATOMIC_H +#ifdef __cplusplus + extern "C" { +#endif + #include "arch/atomic_arch.h" /** @@ -31,5 +35,9 @@ */ unsigned int atomic_set_return(unsigned int *val, unsigned int set); +#ifdef __cplusplus +} +#endif + #endif /* _ATOMIC_H */ /** @} */ diff --git a/core/include/attributes.h b/core/include/attributes.h index 86373d67d7..b01a581f79 100644 --- a/core/include/attributes.h +++ b/core/include/attributes.h @@ -19,6 +19,10 @@ #ifndef ATTRIBUTES_H_ #define ATTRIBUTES_H_ +#ifdef __cplusplus + extern "C" { +#endif + /** * @def NORETURN * @brief The *NORETURN* keyword tells the compiler to assume that the function @@ -68,5 +72,9 @@ #define UNREACHABLE() do { /* nothing */ } while (1) #endif +#ifdef __cplusplus +} +#endif + #endif /* ATTRIBUTES_H_ */ /** @} */ diff --git a/core/include/bitarithm.h b/core/include/bitarithm.h index 7c595a9870..0bbb9c4974 100644 --- a/core/include/bitarithm.h +++ b/core/include/bitarithm.h @@ -20,6 +20,10 @@ #ifndef BITARITHM_H_ #define BITARITHM_H_ +#ifdef __cplusplus + extern "C" { +#endif + /** * @def SETBIT * @brief Sets a bitmask for a bitfield @@ -114,5 +118,9 @@ unsigned bitarithm_lsb(register unsigned v); */ unsigned bitarithm_bits_set(unsigned v); +#ifdef __cplusplus +} +#endif + #endif /* BITARITHM_H_ */ /** @} */ diff --git a/core/include/cib.h b/core/include/cib.h index 37f9f43dbc..f4d11b5997 100644 --- a/core/include/cib.h +++ b/core/include/cib.h @@ -21,6 +21,10 @@ #ifndef __CIB_H #define __CIB_H +#ifdef __cplusplus + extern "C" { +#endif + /** * @brief circular integer buffer structure */ @@ -68,5 +72,9 @@ int cib_put(cib_t *cib); */ int cib_avail(cib_t *cib); +#ifdef __cplusplus +} +#endif + #endif /* __CIB_H */ /** @} */ diff --git a/core/include/clist.h b/core/include/clist.h index f0774e167b..b9469db44b 100644 --- a/core/include/clist.h +++ b/core/include/clist.h @@ -19,6 +19,10 @@ #ifndef __CLIST_H #define __CLIST_H +#ifdef __cplusplus + extern "C" { +#endif + #include "kernel_macros.h" /** @@ -85,5 +89,9 @@ static inline void clist_advance(clist_node_t **list) void clist_print(clist_node_t *clist); #endif +#ifdef __cplusplus +} +#endif + #endif /* __CLIST_H */ /** @} */ diff --git a/core/include/config.h b/core/include/config.h index 21abbf6ca2..91fcce7a37 100644 --- a/core/include/config.h +++ b/core/include/config.h @@ -19,6 +19,10 @@ #ifndef CONFIG_H #define CONFIG_H +#ifdef __cplusplus + extern "C" { +#endif + #include #define CONFIG_KEY (0x1701) /**< key to identify configuration */ @@ -66,5 +70,9 @@ uint8_t config_save(void); */ void config_load(void); +#ifdef __cplusplus +} +#endif + #endif /* CONFIG_H */ /** @} */ diff --git a/core/include/crash.h b/core/include/crash.h index a92d5cc95c..d988b6e60d 100644 --- a/core/include/crash.h +++ b/core/include/crash.h @@ -22,6 +22,10 @@ #ifndef __CRASH_H #define __CRASH_H +#ifdef __cplusplus + extern "C" { +#endif + #include "kernel.h" /** @@ -46,5 +50,9 @@ * */ NORETURN void core_panic(int crash_code, const char *message); +#ifdef __cplusplus +} +#endif + #endif /* __CRASH_H */ /** @} */ diff --git a/core/include/debug.h b/core/include/debug.h index 218b93f13d..781288f3c4 100644 --- a/core/include/debug.h +++ b/core/include/debug.h @@ -21,6 +21,10 @@ #ifndef __DEBUG_H #define __DEBUG_H +#ifdef __cplusplus + extern "C" { +#endif + #include #include "sched.h" @@ -80,5 +84,9 @@ #endif /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* __DEBUG_H */ /** @} */ diff --git a/core/include/flags.h b/core/include/flags.h index dc4b7e1c72..fdcd3ac55f 100644 --- a/core/include/flags.h +++ b/core/include/flags.h @@ -19,6 +19,10 @@ #ifndef _FLAGS_H #define _FLAGS_H +#ifdef __cplusplus + extern "C" { +#endif + /** * @name Optional flags for controlling a threads initial state. * @{ @@ -30,5 +34,9 @@ usage (for debugging) */ /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* _FLAGS_H */ /** @} */ diff --git a/core/include/hwtimer.h b/core/include/hwtimer.h index 53fe374efd..848db82a47 100644 --- a/core/include/hwtimer.h +++ b/core/include/hwtimer.h @@ -33,6 +33,10 @@ #ifndef __HWTIMER_H #define __HWTIMER_H +#ifdef __cplusplus + extern "C" { +#endif + #include #include "hwtimer_cpu.h" #include "board.h" @@ -172,5 +176,9 @@ void hwtimer_init_comp(uint32_t fcpu); */ void hwtimer_spin(unsigned long ticks); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* __HWTIMER_H */ diff --git a/core/include/io.h b/core/include/io.h index 8ac2970b47..45100b6737 100644 --- a/core/include/io.h +++ b/core/include/io.h @@ -21,6 +21,10 @@ #ifndef IO_H #define IO_H +#ifdef __cplusplus + extern "C" { +#endif + /** * @brief Firmware putstring implementation * @@ -29,5 +33,9 @@ */ int fw_puts(char *data, int count); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* IO_H */ diff --git a/core/include/irq.h b/core/include/irq.h index e0d6e75735..9e53da0792 100644 --- a/core/include/irq.h +++ b/core/include/irq.h @@ -21,6 +21,10 @@ #ifndef IRQ_H_ #define IRQ_H_ +#ifdef __cplusplus + extern "C" { +#endif + #include #include "arch/irq_arch.h" @@ -69,5 +73,9 @@ void restoreIRQ(unsigned state); */ int inISR(void); +#ifdef __cplusplus +} +#endif + #endif /* IRQ_H_ */ /** @} */ diff --git a/core/include/kernel.h b/core/include/kernel.h index 83548df3c9..c1a51fd62b 100644 --- a/core/include/kernel.h +++ b/core/include/kernel.h @@ -22,6 +22,10 @@ #ifndef KERNEL_H_ #define KERNEL_H_ +#ifdef __cplusplus + extern "C" { +#endif + #include #include @@ -136,5 +140,9 @@ int reboot(int mode); */ #define RB_AUTOBOOT 0 +#ifdef __cplusplus +} +#endif + #endif /* KERNEL_H_ */ /** @} */ diff --git a/core/include/kernel_internal.h b/core/include/kernel_internal.h index 7642e47123..22592dce9b 100644 --- a/core/include/kernel_internal.h +++ b/core/include/kernel_internal.h @@ -19,6 +19,10 @@ #ifndef KERNEL_INTERNAL_H_ #define KERNEL_INTERNAL_H_ +#ifdef __cplusplus + extern "C" { +#endif + #include "attributes.h" /** @@ -55,5 +59,9 @@ NORETURN void sched_task_exit(void); */ void thread_print_stack(void); +#ifdef __cplusplus +} +#endif + #endif /* KERNEL_INTERNAL_H_ */ /** @} */ diff --git a/core/include/kernel_types.h b/core/include/kernel_types.h index 94ea4c9cfb..44f5670efe 100644 --- a/core/include/kernel_types.h +++ b/core/include/kernel_types.h @@ -9,6 +9,10 @@ #ifndef KERNEL_TYPES_H #define KERNEL_TYPES_H +#ifdef __cplusplus + extern "C" { +#endif + #include #include #include @@ -63,4 +67,8 @@ */ typedef int16_t kernel_pid_t; +#ifdef __cplusplus +} +#endif + #endif /* KERNEL_TYPES_H */ diff --git a/core/include/lifo.h b/core/include/lifo.h index fa018d39a0..006c8cc526 100644 --- a/core/include/lifo.h +++ b/core/include/lifo.h @@ -23,6 +23,10 @@ #ifndef __LIFO_H_ #define __LIFO_H_ +#ifdef __cplusplus + extern "C" { +#endif + /** * @brief Check if the given lifo is empty. * @@ -62,5 +66,9 @@ void lifo_insert(int *array, int i); */ int lifo_get(int *array); +#ifdef __cplusplus +} +#endif + #endif /* __LIFO_H_ */ /** @} */ diff --git a/core/include/lpm.h b/core/include/lpm.h index 2e5e0767d9..bbce3d99fd 100644 --- a/core/include/lpm.h +++ b/core/include/lpm.h @@ -23,6 +23,10 @@ #ifndef LPM_H_ #define LPM_H_ +#ifdef __cplusplus + extern "C" { +#endif + #include "arch/lpm_arch.h" /** @@ -60,5 +64,9 @@ void lpm_end_awake(void); */ enum lpm_mode lpm_get(void); +#ifdef __cplusplus +} +#endif + #endif /* __LPM_H_ */ /** @} */ diff --git a/core/include/msg.h b/core/include/msg.h index 16e842ef48..f915ac619f 100644 --- a/core/include/msg.h +++ b/core/include/msg.h @@ -32,6 +32,10 @@ #ifndef __MSG_H_ #define __MSG_H_ +#ifdef __cplusplus + extern "C" { +#endif + #include #include #include "kernel_types.h" @@ -180,5 +184,9 @@ int msg_reply(msg_t *m, msg_t *reply); */ int msg_init_queue(msg_t *array, int num); +#ifdef __cplusplus +} +#endif + #endif /* __MSG_H_ */ /** @} */ diff --git a/core/include/mutex.h b/core/include/mutex.h index 68f8fe797c..c5b16e9a22 100644 --- a/core/include/mutex.h +++ b/core/include/mutex.h @@ -21,6 +21,10 @@ #ifndef __MUTEX_H_ #define __MUTEX_H_ +#ifdef __cplusplus + extern "C" { +#endif + #include "priority_queue.h" /** @@ -92,5 +96,9 @@ void mutex_unlock(mutex_t *mutex); */ void mutex_unlock_and_sleep(mutex_t *mutex); +#ifdef __cplusplus +} +#endif + #endif /* __MUTEX_H_ */ /** @} */ diff --git a/core/include/priority_queue.h b/core/include/priority_queue.h index 271cbcdf49..f293f41cd9 100644 --- a/core/include/priority_queue.h +++ b/core/include/priority_queue.h @@ -19,6 +19,10 @@ #ifndef __QUEUE_H #define __QUEUE_H +#ifdef __cplusplus + extern "C" { +#endif + #include #include @@ -110,5 +114,9 @@ void priority_queue_print(priority_queue_t *root); void priority_queue_print_node(priority_queue_t *root); #endif +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* __QUEUE_H */ diff --git a/core/include/sched.h b/core/include/sched.h index 11304013fd..256fbad0ce 100644 --- a/core/include/sched.h +++ b/core/include/sched.h @@ -80,6 +80,10 @@ #ifndef _SCHEDULER_H #define _SCHEDULER_H +#ifdef __cplusplus + extern "C" { +#endif + #include #include "bitarithm.h" #include "tcb.h" @@ -178,5 +182,9 @@ void sched_register_cb(void (*callback)(uint32_t, uint32_t)); #endif +#ifdef __cplusplus +} +#endif + #endif // _SCHEDULER_H /** @} */ diff --git a/core/include/tcb.h b/core/include/tcb.h index ef94f6c979..c18ced072d 100644 --- a/core/include/tcb.h +++ b/core/include/tcb.h @@ -20,6 +20,10 @@ #ifndef TCB_H_ #define TCB_H_ +#ifdef __cplusplus + extern "C" { +#endif + #include #include "priority_queue.h" #include "clist.h" @@ -78,5 +82,9 @@ typedef struct tcb_t { #endif } tcb_t; +#ifdef __cplusplus +} +#endif + #endif /* TCB_H_ */ /** @} */ diff --git a/core/include/thread.h b/core/include/thread.h index 89730218a8..47569d0782 100644 --- a/core/include/thread.h +++ b/core/include/thread.h @@ -21,6 +21,9 @@ #ifndef __THREAD_H #define __THREAD_H +#ifdef __cplusplus + extern "C" { +#endif #include "kernel.h" #include "tcb.h" @@ -156,5 +159,9 @@ static inline kernel_pid_t thread_getpid(void) int thread_measure_stack_free(char *stack); #endif +#ifdef __cplusplus +} +#endif + /* @} */ #endif /* __THREAD_H */