core: moved #includes outside the extern "C" guards

This commit is contained in:
BytesGalore 2014-10-13 14:44:28 +02:00
parent a2bb383a86
commit 74161f0f2d
20 changed files with 68 additions and 54 deletions

View File

@ -19,12 +19,12 @@
#ifndef __THREAD_ARCH_H #ifndef __THREAD_ARCH_H
#define __THREAD_ARCH_H #define __THREAD_ARCH_H
#include "attributes.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "attributes.h"
/** /**
* @name Define the mapping between the architecture independent interfaces * @name Define the mapping between the architecture independent interfaces
* and the kernel internal interfaces * and the kernel internal interfaces

View File

@ -19,12 +19,12 @@
#ifndef _ATOMIC_H #ifndef _ATOMIC_H
#define _ATOMIC_H #define _ATOMIC_H
#include "arch/atomic_arch.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "arch/atomic_arch.h"
/** /**
* @brief Sets a new and returns the old value of a variable atomically * @brief Sets a new and returns the old value of a variable atomically
* *

View File

@ -21,6 +21,9 @@
#include <stdint.h> #include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ******************************* INTERFACE ******************************* */ /* ******************************* INTERFACE ******************************* */
@ -310,5 +313,9 @@ uint64_t byteorder_ntohll(network_uint64_t v)
return _byteorder_swap(v.u64, ll); return _byteorder_swap(v.u64, ll);
} }
#ifdef __cplusplus
}
#endif
#endif /* BYTEORDER_H_ */ #endif /* BYTEORDER_H_ */
/** @} */ /** @} */

View File

@ -19,12 +19,12 @@
#ifndef __CLIST_H #ifndef __CLIST_H
#define __CLIST_H #define __CLIST_H
#include "kernel_macros.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "kernel_macros.h"
/** /**
* @def clist_get_container(NODE, TYPE, MEMBER) * @def clist_get_container(NODE, TYPE, MEMBER)
* @brief Returns the container of the circular list * @brief Returns the container of the circular list

View File

@ -19,12 +19,12 @@
#ifndef CONFIG_H #ifndef CONFIG_H
#define CONFIG_H #define CONFIG_H
#include <stdint.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stdint.h>
#define CONFIG_KEY (0x1701) /**< key to identify configuration */ #define CONFIG_KEY (0x1701) /**< key to identify configuration */
#define CONFIG_NAME_LEN (10) /**< length of name for configuration in bytes */ #define CONFIG_NAME_LEN (10) /**< length of name for configuration in bytes */

View File

@ -22,12 +22,12 @@
#ifndef __CRASH_H #ifndef __CRASH_H
#define __CRASH_H #define __CRASH_H
#include "kernel.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "kernel.h"
/** /**
* @brief Handle an unrecoverable error by halting or rebooting the system * @brief Handle an unrecoverable error by halting or rebooting the system
* *

View File

@ -21,13 +21,13 @@
#ifndef __DEBUG_H #ifndef __DEBUG_H
#define __DEBUG_H #define __DEBUG_H
#include <stdio.h>
#include "sched.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stdio.h>
#include "sched.h"
/** /**
* @name Print debug information if the calling thread stack is large enough * @name Print debug information if the calling thread stack is large enough
* *

View File

@ -33,14 +33,14 @@
#ifndef __HWTIMER_H #ifndef __HWTIMER_H
#define __HWTIMER_H #define __HWTIMER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h> #include <stdint.h>
#include "hwtimer_cpu.h" #include "hwtimer_cpu.h"
#include "board.h" #include "board.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Number of kernel timer ticks per second * @brief Number of kernel timer ticks per second
* @def HWTIMER_SPEED * @def HWTIMER_SPEED

View File

@ -21,13 +21,13 @@
#ifndef IRQ_H_ #ifndef IRQ_H_
#define IRQ_H_ #define IRQ_H_
#include <stdbool.h>
#include "arch/irq_arch.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stdbool.h>
#include "arch/irq_arch.h"
/** /**
* @brief This function sets the IRQ disable bit in the status register * @brief This function sets the IRQ disable bit in the status register
* *

View File

@ -22,10 +22,6 @@
#ifndef KERNEL_H_ #ifndef KERNEL_H_
#define KERNEL_H_ #define KERNEL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
@ -37,6 +33,10 @@
#include "sched.h" #include "sched.h"
#include "cpu-conf.h" #include "cpu-conf.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @def KERNEL_CONF_STACKSIZE_DEFAULT * @def KERNEL_CONF_STACKSIZE_DEFAULT
* @brief A reasonable default stack size that will suffice most smaller tasks * @brief A reasonable default stack size that will suffice most smaller tasks

View File

@ -19,12 +19,12 @@
#ifndef KERNEL_INTERNAL_H_ #ifndef KERNEL_INTERNAL_H_
#define KERNEL_INTERNAL_H_ #define KERNEL_INTERNAL_H_
#include "attributes.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "attributes.h"
/** /**
* @brief Initializes scheduler and creates main and idle task * @brief Initializes scheduler and creates main and idle task
*/ */

View File

@ -18,6 +18,10 @@
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @def container_of(PTR, TYPE, MEMBER) * @def container_of(PTR, TYPE, MEMBER)
* @brief Returns the container of a pointer to a member. * @brief Returns the container of a pointer to a member.
@ -50,6 +54,10 @@
((TYPE *) ((char *) (PTR) - offsetof(TYPE, MEMBER))) ((TYPE *) ((char *) (PTR) - offsetof(TYPE, MEMBER)))
#endif #endif
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -6,7 +6,6 @@
* directory for more details. * directory for more details.
*/ */
/** /**
* @addtogroup core_util * @addtogroup core_util
* @{ * @{
@ -22,10 +21,6 @@
#ifndef KERNEL_TYPES_H #ifndef KERNEL_TYPES_H
#define KERNEL_TYPES_H #define KERNEL_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h> #include <stdint.h>
#include <inttypes.h> #include <inttypes.h>
#include <limits.h> #include <limits.h>
@ -47,6 +42,10 @@
# endif # endif
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @def MAXTHREADS * @def MAXTHREADS
* @brief The maximum number of threads to be scheduled * @brief The maximum number of threads to be scheduled

View File

@ -23,12 +23,12 @@
#ifndef LPM_H_ #ifndef LPM_H_
#define LPM_H_ #define LPM_H_
#include "arch/lpm_arch.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "arch/lpm_arch.h"
/** /**
* @brief Initialization of power management (including clock setup) * @brief Initialization of power management (including clock setup)
* *

View File

@ -32,14 +32,14 @@
#ifndef __MSG_H_ #ifndef __MSG_H_
#define __MSG_H_ #define __MSG_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "kernel_types.h" #include "kernel_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Describes a message object which can be sent between threads. * @brief Describes a message object which can be sent between threads.
* *

View File

@ -21,12 +21,12 @@
#ifndef __MUTEX_H_ #ifndef __MUTEX_H_
#define __MUTEX_H_ #define __MUTEX_H_
#include "priority_queue.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "priority_queue.h"
/** /**
* @brief Mutex structure. Must never be modified by the user. * @brief Mutex structure. Must never be modified by the user.
*/ */

View File

@ -19,13 +19,13 @@
#ifndef __QUEUE_H #ifndef __QUEUE_H
#define __QUEUE_H #define __QUEUE_H
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stddef.h>
#include <stdint.h>
/** /**
* data type for priority queue nodes * data type for priority queue nodes
*/ */

View File

@ -80,16 +80,16 @@
#ifndef _SCHEDULER_H #ifndef _SCHEDULER_H
#define _SCHEDULER_H #define _SCHEDULER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h> #include <stddef.h>
#include "bitarithm.h" #include "bitarithm.h"
#include "tcb.h" #include "tcb.h"
#include "attributes.h" #include "attributes.h"
#include "kernel_types.h" #include "kernel_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @def SCHED_PRIO_LEVELS * @def SCHED_PRIO_LEVELS
* @brief The number of thread priority levels * @brief The number of thread priority levels

View File

@ -20,16 +20,16 @@
#ifndef TCB_H_ #ifndef TCB_H_
#define TCB_H_ #define TCB_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h> #include <stdint.h>
#include "priority_queue.h" #include "priority_queue.h"
#include "clist.h" #include "clist.h"
#include "cib.h" #include "cib.h"
#include "msg.h" #include "msg.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Thread status list * @brief Thread status list
* @{ * @{

View File

@ -21,14 +21,14 @@
#ifndef __THREAD_H #ifndef __THREAD_H
#define __THREAD_H #define __THREAD_H
#ifdef __cplusplus
extern "C" {
#endif
#include "kernel.h" #include "kernel.h"
#include "tcb.h" #include "tcb.h"
#include "arch/thread_arch.h" #include "arch/thread_arch.h"
#ifdef __cplusplus
extern "C" {
#endif
#define STATUS_NOT_FOUND (-1) #define STATUS_NOT_FOUND (-1)
/** /**