From a0e45687606d6e9252a8067fd1db39896c3cd3e0 Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Fri, 22 Jan 2016 12:38:49 -0500 Subject: [PATCH] c++: Add extern "C" { } block to header files Adds extern "C" { } blocks to header files so that they can be safely used by C++ source files. Change-Id: Ia4db0c36a5dac5d3de351184a297d2af0df64532 Signed-off-by: Peter Mitsis --- arch/arc/core/swap_macros.h | 9 +++++++++ arch/arc/include/v2/cache.h | 9 +++++++++ arch/arc/include/v2/irq.h | 9 +++++++++ arch/arc/include/vector_table.h | 8 ++++++++ arch/arm/core/cortex_m/vector_table.h | 8 ++++++++ arch/arm/include/cortex_m/asm_inline_gcc.h | 9 +++++++++ arch/arm/include/cortex_m/exc.h | 9 +++++++++ arch/arm/include/cortex_m/stack.h | 8 ++++++++ arch/arm/include/kernel_event_logger_arch.h | 8 ++++++++ arch/arm/include/start_task_arch.h | 8 ++++++++ arch/arm/soc/fsl_frdm_k64f/soc.h | 8 ++++++++ arch/arm/soc/ti_lm3s6965/scp.h | 9 +++++++++ arch/arm/soc/ti_lm3s6965/soc.h | 8 ++++++++ arch/x86/include/advidle.h | 8 ++++++++ arch/x86/include/asm_inline_gcc.h | 9 +++++++++ arch/x86/include/cache_private.h | 8 ++++++++ arch/x86/include/gdt.h | 9 +++++++++ arch/x86/include/idtEnt.h | 3 +-- arch/x86/include/kernel_event_logger_arch.h | 8 ++++++++ arch/x86/include/start_task_arch.h | 8 ++++++++ arch/x86/include/swapstk.h | 8 ++++++++ arch/x86/soc/quark_x1000/soc.h | 8 ++++++++ drivers/adc/adc_dw.h | 8 ++++++++ drivers/adc/adc_ti_adc108s102.h | 9 ++++++++- drivers/bluetooth/uart.h | 8 ++++++++ drivers/ethernet/eth_dw_priv.h | 8 ++++++++ drivers/gpio/gpio_dw.h | 9 +++++++++ drivers/gpio/gpio_mmio.h | 8 ++++++++ drivers/gpio/gpio_pcal9535a.h | 8 ++++++++ drivers/i2c/i2c_dw.h | 8 ++++++++ drivers/i2c/i2c_dw_registers.h | 7 +++++++ drivers/i2c/i2c_quark_se_ss.h | 8 ++++++++ drivers/ipm/ipm_quark_se.h | 7 +++++++ drivers/pinmux/pinmux.h | 8 ++++++++ drivers/pwm/pwm_pca9685.h | 8 ++++++++ drivers/rtc/rtc_dw.h | 8 ++++++++ drivers/serial/uart_k20_priv.h | 8 ++++++++ drivers/spi/spi_dw.h | 8 ++++++++ drivers/spi/spi_intel.h | 6 ++++++ include/adc.h | 8 ++++++++ include/aio_comparator.h | 8 ++++++++ include/arch/arc/v2/arcv2_irq_unit.h | 9 +++++++++ include/arch/arc/v2/asm_inline_gcc.h | 9 +++++++++ include/arch/arc/v2/aux_regs.h | 8 ++++++++ include/arch/arc/v2/error.h | 9 +++++++++ include/arch/arc/v2/exc.h | 9 +++++++++ include/arch/arc/v2/ffs.h | 8 ++++++++ include/arch/arc/v2/irq.h | 9 +++++++++ include/arch/arc/v2/misc.h | 8 ++++++++ include/arch/arm/cortex_m/asm_inline_gcc.h | 9 +++++++++ include/arch/arm/cortex_m/error.h | 8 ++++++++ include/arch/arm/cortex_m/exc.h | 8 ++++++++ include/arch/arm/cortex_m/gdb_stub.h | 9 +++++++++ include/arch/arm/cortex_m/irq.h | 8 ++++++++ include/arch/arm/cortex_m/misc.h | 8 ++++++++ include/arch/arm/cortex_m/nvic.h | 8 ++++++++ include/arch/arm/cortex_m/scb.h | 8 ++++++++ include/arch/arm/cortex_m/scs.h | 8 ++++++++ include/arch/x86/arch.h | 8 ++++++++ include/arch/x86/asm_inline_gcc.h | 9 +++++++++ include/bluetooth/bluetooth.h | 9 +++++++++ include/bluetooth/conn.h | 8 ++++++++ include/bluetooth/driver.h | 8 ++++++++ include/bluetooth/gatt.h | 9 +++++++++ include/bluetooth/hci.h | 8 ++++++++ include/bluetooth/l2cap.h | 9 +++++++++ include/bluetooth/log.h | 8 ++++++++ include/bluetooth/uuid.h | 8 ++++++++ include/cache.h | 8 ++++++++ include/device.h | 8 ++++++++ include/display/grove_lcd.h | 8 ++++++++ include/drivers/console/ipm_console.h | 8 ++++++++ include/drivers/console/uart_pipe.h | 8 ++++++++ include/drivers/k20_mcg.h | 8 ++++++++ include/drivers/k20_pcr.h | 8 ++++++++ include/drivers/k20_sim.h | 8 ++++++++ include/drivers/k20_watchdog.h | 8 ++++++++ include/drivers/k6x_mpu.h | 8 ++++++++ include/drivers/k6x_pmc.h | 8 ++++++++ include/drivers/pci/pci.h | 8 ++++++++ include/drivers/rand32.h | 8 ++++++++ include/drivers/serial/uart_nsim.h | 8 ++++++++ include/drivers/spi/spi_intel.h | 7 +++++++ include/drivers/system_timer.h | 8 ++++++++ include/init.h | 8 ++++++++ include/ipm.h | 8 ++++++++ include/irq_offload.h | 8 ++++++++ include/kernel_version.h | 8 ++++++++ include/microkernel.h | 8 ++++++++ include/microkernel/task_irq.h | 9 +++++++++ include/misc/debug/mem_safe.h | 8 ++++++++ include/misc/dlist.h | 8 ++++++++ include/misc/event_logger.h | 9 +++++++++ include/misc/kernel_event_logger.h | 8 ++++++++ include/misc/printk.h | 8 ++++++++ include/misc/reboot.h | 9 +++++++++ include/misc/ring_buffer.h | 8 ++++++++ include/misc/shell.h | 9 +++++++++ include/net/buf.h | 8 ++++++++ include/net/ip_buf.h | 8 ++++++++ include/net/l2_buf.h | 8 ++++++++ include/net/net_core.h | 8 ++++++++ include/net/net_ip.h | 8 ++++++++ include/net/net_socket.h | 8 ++++++++ include/pinmux.h | 9 +++++++++ include/rtc.h | 8 ++++++++ include/shared_irq.h | 8 ++++++++ include/sw_isr_table.h | 8 ++++++++ include/sys_clock.h | 8 ++++++++ include/watchdog.h | 8 ++++++++ kernel/microkernel/include/k_pipe_util.h | 7 +++++++ kernel/microkernel/include/micro_private.h | 8 ++++++++ kernel/nanokernel/include/timeout_q.h | 8 ++++++++ kernel/nanokernel/include/wait_q.h | 8 ++++++++ lib/crypto/tinycrypt/include/tinycrypt/aes.h | 8 ++++++++ lib/crypto/tinycrypt/include/tinycrypt/cbc_mode.h | 8 ++++++++ lib/crypto/tinycrypt/include/tinycrypt/ctr_mode.h | 8 ++++++++ lib/crypto/tinycrypt/include/tinycrypt/hmac.h | 8 ++++++++ lib/crypto/tinycrypt/include/tinycrypt/hmac_prng.h | 8 ++++++++ lib/crypto/tinycrypt/include/tinycrypt/sha256.h | 8 ++++++++ lib/crypto/tinycrypt/include/tinycrypt/utils.h | 8 ++++++++ lib/libc/minimal/include/ctype.h | 8 ++++++++ lib/libc/minimal/include/limits.h | 8 ++++++++ lib/libc/minimal/include/stdint.h | 8 ++++++++ lib/libc/minimal/include/stdio.h | 8 ++++++++ lib/libc/minimal/include/stdlib.h | 7 +++++++ lib/libc/minimal/include/string.h | 8 ++++++++ lib/libc/minimal/include/strings.h | 8 ++++++++ 128 files changed, 1035 insertions(+), 3 deletions(-) diff --git a/arch/arc/core/swap_macros.h b/arch/arc/core/swap_macros.h index e3debf8bdaf..805d197eaa3 100644 --- a/arch/arc/core/swap_macros.h +++ b/arch/arc/core/swap_macros.h @@ -24,6 +24,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE /* entering this macro, current is in r2 */ @@ -159,4 +163,9 @@ .endm #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _SWAP_MACROS__H_ */ diff --git a/arch/arc/include/v2/cache.h b/arch/arc/include/v2/cache.h index c8ac5e73de4..035b81cd02d 100644 --- a/arch/arc/include/v2/cache.h +++ b/arch/arc/include/v2/cache.h @@ -27,6 +27,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE #define CACHE_ENABLE 0x00 @@ -49,4 +53,9 @@ static ALWAYS_INLINE void _icache_setup(void) } #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _ARCV2_CACHE__H_ */ diff --git a/arch/arc/include/v2/irq.h b/arch/arc/include/v2/irq.h index d5355c48633..e000bae0278 100644 --- a/arch/arc/include/v2/irq.h +++ b/arch/arc/include/v2/irq.h @@ -25,6 +25,10 @@ #ifndef _ARCV2_IRQ__H_ #define _ARCV2_IRQ__H_ +#ifdef __cplusplus +extern "C" { +#endif + #define _ARC_V2_AUX_IRQ_CTRL_BLINK (1 << 9) #define _ARC_V2_AUX_IRQ_CTRL_LOOP_REGS (1 << 10) #define _ARC_V2_AUX_IRQ_CTRL_14_REGS 7 @@ -60,4 +64,9 @@ static ALWAYS_INLINE void _irq_setup(void) } #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _ARCV2_IRQ__H_ */ diff --git a/arch/arc/include/vector_table.h b/arch/arc/include/vector_table.h index cb50448d156..624e1df0046 100644 --- a/arch/arc/include/vector_table.h +++ b/arch/arc/include/vector_table.h @@ -31,6 +31,10 @@ #ifndef _VECTOR_TABLE__H_ #define _VECTOR_TABLE__H_ +#ifdef __cplusplus +extern "C" { +#endif + #define EXC_EV_TRAP 0x9 #ifdef _ASMLANGUAGE @@ -79,4 +83,8 @@ extern void __ev_maligned(void); #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _VECTOR_TABLE__H_ */ diff --git a/arch/arm/core/cortex_m/vector_table.h b/arch/arm/core/cortex_m/vector_table.h index f2af60a2a95..bf1673c66ac 100644 --- a/arch/arm/core/cortex_m/vector_table.h +++ b/arch/arm/core/cortex_m/vector_table.h @@ -31,6 +31,10 @@ #ifndef _VECTOR_TABLE__H_ #define _VECTOR_TABLE__H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE #include @@ -61,4 +65,8 @@ GTEXT(_isr_wrapper) #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _VECTOR_TABLE__H_ */ diff --git a/arch/arm/include/cortex_m/asm_inline_gcc.h b/arch/arm/include/cortex_m/asm_inline_gcc.h index e8b7e6f44ed..3c74d7e7b7d 100644 --- a/arch/arm/include/cortex_m/asm_inline_gcc.h +++ b/arch/arm/include/cortex_m/asm_inline_gcc.h @@ -19,6 +19,10 @@ #ifndef _ASM_INLINE_GCC_H #define _ASM_INLINE_GCC_H +#ifdef __cplusplus +extern "C" { +#endif + /* * The file must not be included directly * Include asm_inline.h instead @@ -57,4 +61,9 @@ static ALWAYS_INLINE void _MspSet(uint32_t msp /* value to store in MSP */ } #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _ASM_INLINE_GCC_H */ diff --git a/arch/arm/include/cortex_m/exc.h b/arch/arm/include/cortex_m/exc.h index e6f5c29ca62..2fb05e64db7 100644 --- a/arch/arm/include/cortex_m/exc.h +++ b/arch/arm/include/cortex_m/exc.h @@ -27,6 +27,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE /* nothing */ @@ -80,4 +84,9 @@ static ALWAYS_INLINE void _ExcSetup(void) #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + + #endif /* _ARM_CORTEXM_ISR__H_ */ diff --git a/arch/arm/include/cortex_m/stack.h b/arch/arm/include/cortex_m/stack.h index cd1d29e5f6e..79808d231b0 100644 --- a/arch/arm/include/cortex_m/stack.h +++ b/arch/arm/include/cortex_m/stack.h @@ -27,6 +27,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifdef CONFIG_STACK_ALIGN_DOUBLE_WORD #define STACK_ALIGN_SIZE 8 #else @@ -62,4 +66,8 @@ static ALWAYS_INLINE void _InterruptStackSetup(void) #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _ARM_CORTEXM_STACK__H_ */ diff --git a/arch/arm/include/kernel_event_logger_arch.h b/arch/arm/include/kernel_event_logger_arch.h index 3c08b9473d4..01ac3d97030 100644 --- a/arch/arm/include/kernel_event_logger_arch.h +++ b/arch/arm/include/kernel_event_logger_arch.h @@ -22,6 +22,10 @@ #ifndef __KERNEL_EVENT_LOGGER_ARCH_H__ #define __KERNEL_EVENT_LOGGER_ARCH_H__ +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Get the identification of the current interrupt. * @@ -35,4 +39,8 @@ int _sys_current_irq_key_get(void) return _IpsrGet(); } +#ifdef __cplusplus +} +#endif + #endif /* __KERNEL_EVENT_LOGGER_ARCH_H__ */ diff --git a/arch/arm/include/start_task_arch.h b/arch/arm/include/start_task_arch.h index 93e819fa5cf..977d1918d54 100644 --- a/arch/arm/include/start_task_arch.h +++ b/arch/arm/include/start_task_arch.h @@ -33,8 +33,16 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define _START_TASK_ARCH(task, opt_ptr) \ do {/* nothing */ \ } while ((0)) +#ifdef __cplusplus +} +#endif + #endif /* _START_TASK_ARCH__H_ */ diff --git a/arch/arm/soc/fsl_frdm_k64f/soc.h b/arch/arm/soc/fsl_frdm_k64f/soc.h index cb17500fd87..a0dcd03b9e3 100644 --- a/arch/arm/soc/fsl_frdm_k64f/soc.h +++ b/arch/arm/soc/fsl_frdm_k64f/soc.h @@ -27,6 +27,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* default system clock */ #define SYSCLK_DEFAULT_IOSC_HZ MHZ(120) @@ -163,4 +167,8 @@ #endif /* !_ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _SOC__H_ */ diff --git a/arch/arm/soc/ti_lm3s6965/scp.h b/arch/arm/soc/ti_lm3s6965/scp.h index 0fa37271eda..d10c3b5ceb2 100644 --- a/arch/arm/soc/ti_lm3s6965/scp.h +++ b/arch/arm/soc/ti_lm3s6965/scp.h @@ -39,6 +39,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define _SCP_OSC_SOURCE_MAIN 0 #define _SCP_OSC_SOURCE_INTERNAL 1 #define _SCP_OSC_SOURCE_INTERNAL_DIV4 2 @@ -162,4 +166,9 @@ struct __scp { }; extern volatile struct __scp __scp; + +#ifdef __cplusplus +} +#endif + #endif /* _SCP_H_ */ diff --git a/arch/arm/soc/ti_lm3s6965/soc.h b/arch/arm/soc/ti_lm3s6965/soc.h index b8bdca4cfb7..bbb444dfe18 100644 --- a/arch/arm/soc/ti_lm3s6965/soc.h +++ b/arch/arm/soc/ti_lm3s6965/soc.h @@ -27,6 +27,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* default system clock */ #define SYSCLK_DEFAULT_IOSC_HZ MHZ(12) @@ -90,4 +94,8 @@ #endif /* !_ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _BOARD__H_ */ diff --git a/arch/x86/include/advidle.h b/arch/x86/include/advidle.h index b4d3bb158f4..08f8cb7a60e 100644 --- a/arch/x86/include/advidle.h +++ b/arch/x86/include/advidle.h @@ -28,6 +28,10 @@ #ifndef __INCadvidle #define __INCadvidle +#ifdef __cplusplus +extern "C" { +#endif + #ifdef CONFIG_ADVANCED_IDLE /** @@ -74,4 +78,8 @@ extern int _AdvIdleFunc(int32_t ticks); #endif /* CONFIG_ADVANCED_IDLE */ +#ifdef __cplusplus +} +#endif + #endif /* __INCadvidle */ diff --git a/arch/x86/include/asm_inline_gcc.h b/arch/x86/include/asm_inline_gcc.h index efaae3aa10c..0d222ffca52 100644 --- a/arch/x86/include/asm_inline_gcc.h +++ b/arch/x86/include/asm_inline_gcc.h @@ -19,6 +19,10 @@ #ifndef _ASM_INLINE_GCC_H #define _ASM_INLINE_GCC_H +#ifdef __cplusplus +extern "C" { +#endif + /* * The file must not be included directly * Include asm_inline.h instead @@ -136,4 +140,9 @@ static inline void _do_fp_ctx_init(int flags) #endif /* CONFIG_FP_SHARING */ #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _ASM_INLINE_GCC_H */ diff --git a/arch/x86/include/cache_private.h b/arch/x86/include/cache_private.h index 503c5499b7f..028e64d40df 100644 --- a/arch/x86/include/cache_private.h +++ b/arch/x86/include/cache_private.h @@ -19,8 +19,16 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + extern int _is_clflush_available(void); extern void _cache_flush_wbinvd(vaddr_t, size_t); extern size_t _cache_line_size_get(void); +#ifdef __cplusplus +} +#endif + #endif /* _cache_private__h_ */ diff --git a/arch/x86/include/gdt.h b/arch/x86/include/gdt.h index 07f95080048..e3b6d0b07c2 100644 --- a/arch/x86/include/gdt.h +++ b/arch/x86/include/gdt.h @@ -27,6 +27,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE #include @@ -63,4 +67,9 @@ extern tGdtHeader _gdt; /* GDT is implemented in arch/x86/core/gdt.c */ #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _GDT_H */ diff --git a/arch/x86/include/idtEnt.h b/arch/x86/include/idtEnt.h index 6d79c68e3ed..60fd3196b2c 100644 --- a/arch/x86/include/idtEnt.h +++ b/arch/x86/include/idtEnt.h @@ -26,8 +26,7 @@ #define _IDTENT_H #ifdef __cplusplus -extern"C" -{ +extern "C" { #endif /** diff --git a/arch/x86/include/kernel_event_logger_arch.h b/arch/x86/include/kernel_event_logger_arch.h index 80904fa8c7a..e48be60e395 100644 --- a/arch/x86/include/kernel_event_logger_arch.h +++ b/arch/x86/include/kernel_event_logger_arch.h @@ -24,6 +24,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Get the identification of the current interrupt. * @@ -37,4 +41,8 @@ static inline int _sys_current_irq_key_get(void) return _loapic_isr_vector_get(); } +#ifdef __cplusplus +} +#endif + #endif /* __KERNEL_EVENT_LOGGER_ARCH_H__ */ diff --git a/arch/x86/include/start_task_arch.h b/arch/x86/include/start_task_arch.h index 81c814ea202..632106866bf 100644 --- a/arch/x86/include/start_task_arch.h +++ b/arch/x86/include/start_task_arch.h @@ -31,8 +31,16 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + extern void _StartTaskArch(struct k_task *, unsigned int *); #define _START_TASK_ARCH(task, opt_ptr) _StartTaskArch(task, opt_ptr) +#ifdef __cplusplus +} +#endif + #endif /* _START_TASK_ARCH__H_ */ diff --git a/arch/x86/include/swapstk.h b/arch/x86/include/swapstk.h index 2749d0b64ba..90dcaff38f4 100644 --- a/arch/x86/include/swapstk.h +++ b/arch/x86/include/swapstk.h @@ -30,6 +30,10 @@ #ifndef _SWAPSTK_H #define _SWAPSTK_H +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE /* Stack of a saved context */ @@ -45,4 +49,8 @@ typedef struct s_SwapStk { #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _SWAPSTK_H */ diff --git a/arch/x86/soc/quark_x1000/soc.h b/arch/x86/soc/quark_x1000/soc.h index 43da62b275e..638ea3f19b9 100644 --- a/arch/x86/soc/quark_x1000/soc.h +++ b/arch/x86/soc/quark_x1000/soc.h @@ -45,6 +45,10 @@ #endif #endif /* CONFIG_IOAPIC */ +#ifdef __cplusplus +extern "C" { +#endif + #define NUM_STD_IRQS 16 /* number of "standard" IRQs on an x86 platform */ #define INT_VEC_IRQ0 0x20 /* Vector number for IRQ0 */ @@ -117,4 +121,8 @@ static inline int pci_irq2pin(int irq) return irq - NUM_STD_IRQS + 1; } +#ifdef __cplusplus +} +#endif + #endif /* __SOC_H_ */ diff --git a/drivers/adc/adc_dw.h b/drivers/adc/adc_dw.h index d3caca8ab00..077d77a2fc9 100644 --- a/drivers/adc/adc_dw.h +++ b/drivers/adc/adc_dw.h @@ -39,6 +39,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * ADC driver name. * @@ -212,4 +216,8 @@ struct adc_info { */ int adc_dw_init(struct device *dev); +#ifdef __cplusplus +} +#endif + #endif /* DW_ADC_H_ */ diff --git a/drivers/adc/adc_ti_adc108s102.h b/drivers/adc/adc_ti_adc108s102.h index d66a8384c84..1d3b32b19b0 100644 --- a/drivers/adc/adc_ti_adc108s102.h +++ b/drivers/adc/adc_ti_adc108s102.h @@ -23,9 +23,12 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Internal return code */ #define ADC108S102_DONE (-1) - /* 8 chans maximum + 1 dummy, 16 bits per-chans -> 18 bytes */ #define ADC108S102_CMD_BUFFER_SIZE 9 /* 1 dummy + 8 results maximum, 16 bits per-chans -> 18 bytes */ @@ -60,4 +63,8 @@ struct ti_adc108s102_data { struct adc_seq_table *seq_table; }; +#ifdef __cplusplus +} +#endif + #endif /* __ADC108S102_PRIV_H__ */ diff --git a/drivers/bluetooth/uart.h b/drivers/bluetooth/uart.h index 6adc51521d9..ed46e31077a 100644 --- a/drivers/bluetooth/uart.h +++ b/drivers/bluetooth/uart.h @@ -16,4 +16,12 @@ * limitations under the License. */ +#ifdef __cplusplus +extern "C" { +#endif + void bt_uart_isr(void *); + +#ifdef __cplusplus +} +#endif diff --git a/drivers/ethernet/eth_dw_priv.h b/drivers/ethernet/eth_dw_priv.h index 4c256132691..caaaf599949 100644 --- a/drivers/ethernet/eth_dw_priv.h +++ b/drivers/ethernet/eth_dw_priv.h @@ -26,6 +26,10 @@ #include "contiki/ip/uip.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*eth_config_irq_t)(struct device *port); struct eth_config { @@ -192,4 +196,8 @@ struct eth_runtime { #define REG_ADDR_DMA_OPERATION 0x1018 #define REG_ADDR_INT_ENABLE 0x101C +#ifdef __cplusplus +} +#endif + #endif /* DRIVERS_ETHERNET_ETH_DW_PRIV_H_ */ diff --git a/drivers/gpio/gpio_dw.h b/drivers/gpio/gpio_dw.h index c74217bf728..a5f82f0f344 100644 --- a/drivers/gpio/gpio_dw.h +++ b/drivers/gpio/gpio_dw.h @@ -23,6 +23,10 @@ #include #endif /* CONFIG_PCI */ +#ifdef __cplusplus +extern "C" { +#endif + extern int gpio_dw_initialize(struct device *port); typedef void (*gpio_config_irq_t)(struct device *port); @@ -52,3 +56,8 @@ struct gpio_dw_runtime { uint32_t enabled_callbacks; uint8_t port_callback; }; + +#ifdef __cplusplus +} +#endif + diff --git a/drivers/gpio/gpio_mmio.h b/drivers/gpio/gpio_mmio.h index f52d6675bbe..f94c63b5122 100644 --- a/drivers/gpio/gpio_mmio.h +++ b/drivers/gpio/gpio_mmio.h @@ -25,6 +25,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* For enable register: * NORMAL: 0 - disable, 1 - enable * INV: 0 - enable, 1 - disable @@ -79,4 +83,8 @@ struct gpio_mmio_config { } access; }; +#ifdef __cplusplus +} +#endif + #endif /* _GPIO_MMIO_H_ */ diff --git a/drivers/gpio/gpio_pcal9535a.h b/drivers/gpio/gpio_pcal9535a.h index ef4e36cfe78..f525d6fdf7e 100644 --- a/drivers/gpio/gpio_pcal9535a.h +++ b/drivers/gpio/gpio_pcal9535a.h @@ -26,6 +26,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Initialization function for PCAL9535A * @@ -73,4 +77,8 @@ struct gpio_pcal9535a_drv_data { } reg_cache; }; +#ifdef __cplusplus +} +#endif + #endif /* _GPIO_PCAL9535A_H_ */ diff --git a/drivers/i2c/i2c_dw.h b/drivers/i2c/i2c_dw.h index 74a81c0adda..16cf047815d 100644 --- a/drivers/i2c/i2c_dw.h +++ b/drivers/i2c/i2c_dw.h @@ -26,6 +26,10 @@ #include #endif /* CONFIG_PCI */ +#ifdef __cplusplus +extern "C" { +#endif + #define I2C_DW_MAGIC_KEY 0x44570140 @@ -123,4 +127,8 @@ struct i2c_dw_dev_config { uint16_t lcnt; }; +#ifdef __cplusplus +} +#endif + #endif /* __DRIVERS_I2C_DW_H */ diff --git a/drivers/i2c/i2c_dw_registers.h b/drivers/i2c/i2c_dw_registers.h index c17e1796d09..5666012c1e7 100644 --- a/drivers/i2c/i2c_dw_registers.h +++ b/drivers/i2c/i2c_dw_registers.h @@ -18,6 +18,9 @@ #ifndef __DRIVERS_I2C_DW_REGISTERS_H #define __DRIVERS_I2C_DW_REGISTERS_H +#ifdef __cplusplus +extern "C" { +#endif /* IC_CON bits */ #define IC_CON_TX_INTR_MODE (1 << 8) @@ -260,4 +263,8 @@ struct i2c_dw_registers { uint32_t ic_comp_type; /* offset 0xFC */ }; +#ifdef __cplusplus +} +#endif + #endif /* __DRIVERS_I2C_DW_REGISTERS_H */ diff --git a/drivers/i2c/i2c_quark_se_ss.h b/drivers/i2c/i2c_quark_se_ss.h index 424ac1b3db3..1d3e80ddd27 100644 --- a/drivers/i2c/i2c_quark_se_ss.h +++ b/drivers/i2c/i2c_quark_se_ss.h @@ -24,6 +24,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* dev->state values from IC_DATA_CMD Data transfer mode settings (bit 8) */ #define I2C_QSE_SS_STATE_READY (0) #define I2C_QSE_SS_CMD_SEND (1 << 0) @@ -73,4 +77,8 @@ struct i2c_qse_ss_dev_config { uint16_t lcnt; }; +#ifdef __cplusplus +} +#endif + #endif /* __DRIVERS_I2C_QUARK_SE_SS_H__ */ diff --git a/drivers/ipm/ipm_quark_se.h b/drivers/ipm/ipm_quark_se.h index 94f90cc7a9c..5b57bf72508 100644 --- a/drivers/ipm/ipm_quark_se.h +++ b/drivers/ipm/ipm_quark_se.h @@ -26,6 +26,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define QUARK_SE_IPM_OUTBOUND 0 #define QUARK_SE_IPM_INBOUND 1 @@ -139,5 +143,8 @@ int quark_se_ipm_controller_initialize(struct device *d); SYS_DEFINE_DEVICE(name, &quark_se_ipm_runtime_##name, SECONDARY, \ CONFIG_KERNEL_INIT_PRIORITY_DEFAULT) +#ifdef __cplusplus +} +#endif #endif /* __INCquark_se_mailboxh */ diff --git a/drivers/pinmux/pinmux.h b/drivers/pinmux/pinmux.h index d70ce483848..c73dd07a325 100644 --- a/drivers/pinmux/pinmux.h +++ b/drivers/pinmux/pinmux.h @@ -21,6 +21,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + struct pin_config { uint8_t pin_num; uint8_t mode; @@ -32,4 +36,8 @@ struct pinmux_config { extern int pinmux_initialize(struct device *port); +#ifdef __cplusplus +} +#endif + #endif /* __DRIVERS_PINMUX_H */ diff --git a/drivers/pwm/pwm_pca9685.h b/drivers/pwm/pwm_pca9685.h index 66be76b1c5e..7952ce984e4 100644 --- a/drivers/pwm/pwm_pca9685.h +++ b/drivers/pwm/pwm_pca9685.h @@ -24,6 +24,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Initialization function for PCA9685 * @@ -47,4 +51,8 @@ struct pwm_pca9685_drv_data { struct device *i2c_master; }; +#ifdef __cplusplus +} +#endif + #endif /* __PWM_PCA9685_H__ */ diff --git a/drivers/rtc/rtc_dw.h b/drivers/rtc/rtc_dw.h index 6726e43425c..4c515e46260 100644 --- a/drivers/rtc/rtc_dw.h +++ b/drivers/rtc/rtc_dw.h @@ -21,6 +21,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define RTC_CCVR (0x0) #define RTC_CMR (0x4) #define RTC_CLR (0x8) @@ -58,4 +62,8 @@ struct rtc_dw_dev_config { int rtc_dw_init(struct device *dev); +#ifdef __cplusplus +} +#endif + #endif /* _RTC_DW_H_ */ diff --git a/drivers/serial/uart_k20_priv.h b/drivers/serial/uart_k20_priv.h index a03d1e9beba..beac7516001 100644 --- a/drivers/serial/uart_k20_priv.h +++ b/drivers/serial/uart_k20_priv.h @@ -26,6 +26,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + union BDH { uint8_t value; struct { @@ -251,4 +255,8 @@ static inline void _uart_k20_fifo_enable(volatile struct K20_UART *uart_p) uart_p->c2.value |= tx_rx_state; } +#ifdef __cplusplus +} +#endif + #endif /* _K20UART_H_ */ diff --git a/drivers/spi/spi_dw.h b/drivers/spi/spi_dw.h index 7a43247afd8..ad1639d2ff7 100644 --- a/drivers/spi/spi_dw.h +++ b/drivers/spi/spi_dw.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*spi_dw_config_t)(void); /* Private structures */ @@ -166,4 +170,8 @@ struct spi_dw_data { DW_SPI_IMR_RXOIM | \ DW_SPI_IMR_RXFIM)) +#ifdef __cplusplus +} +#endif #endif /* __SPI_DW_H__ */ + diff --git a/drivers/spi/spi_intel.h b/drivers/spi/spi_intel.h index 08db3247b85..ca1d32cc6b3 100644 --- a/drivers/spi/spi_intel.h +++ b/drivers/spi/spi_intel.h @@ -23,6 +23,9 @@ #include #include #endif /* CONFIG_PCI */ +#ifdef __cplusplus +extern "C" { +#endif typedef void (*spi_intel_config_t)(void); @@ -114,5 +117,8 @@ struct spi_intel_data { /* DSS_RATE settings */ #define INTEL_SPI_DSS_RATE(__msf) \ ((__msf & (INTEL_SPI_DDS_RATE_MASK)) >> 8) +#ifdef __cplusplus +} +#endif #endif /* __SPI_INTEL_PRIV_H__ */ diff --git a/include/adc.h b/include/adc.h index ff4d06fab99..9c369b839ac 100644 --- a/include/adc.h +++ b/include/adc.h @@ -28,6 +28,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief ADC Interface * @defgroup adc_interface ADC Interface @@ -139,4 +143,8 @@ static inline int adc_read(struct device *dev, struct adc_seq_table *seq_table) * @} */ +#ifdef __cplusplus +} +#endif + #endif /* __INCLUDE_ADC_H__ */ diff --git a/include/aio_comparator.h b/include/aio_comparator.h index ec667e942a2..9f53017493f 100644 --- a/include/aio_comparator.h +++ b/include/aio_comparator.h @@ -17,6 +17,10 @@ #ifndef _AIO_COMPARATOR_H_ #define _AIO_COMPARATOR_H_ +#ifdef __cplusplus +extern "C" { +#endif + enum aio_cmp_ref { AIO_CMP_REF_A, /**< Use reference A. */ AIO_CMP_REF_B, /**< Use reference B. */ @@ -84,4 +88,8 @@ static inline int aio_cmp_configure(struct device *dev, uint8_t index, return api->configure(dev, index, polarity, refsel, cb, param); } +#ifdef __cplusplus +} +#endif + #endif /* _AIO_COMPARATOR_H_ */ diff --git a/include/arch/arc/v2/arcv2_irq_unit.h b/include/arch/arc/v2/arcv2_irq_unit.h index 4ad36e5984e..8646a088ff2 100644 --- a/include/arch/arc/v2/arcv2_irq_unit.h +++ b/include/arch/arc/v2/arcv2_irq_unit.h @@ -19,6 +19,10 @@ #ifndef _ARC_V2_IRQ_UNIT__H #define _ARC_V2_IRQ_UNIT__H +#ifdef __cplusplus +extern "C" { +#endif + /* configuration flags for interrupt unit */ #define _ARC_V2_INT_DISABLE 0 @@ -107,4 +111,9 @@ void _arc_v2_irq_unit_int_eoi(int irq); void _arc_v2_irq_unit_init(void); #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _ARC_V2_IRQ_UNIT__H */ diff --git a/include/arch/arc/v2/asm_inline_gcc.h b/include/arch/arc/v2/asm_inline_gcc.h index f1500f6c57f..6d8ece96304 100644 --- a/include/arch/arc/v2/asm_inline_gcc.h +++ b/include/arch/arc/v2/asm_inline_gcc.h @@ -19,6 +19,10 @@ #ifndef __ASM_INLINE_GCC_H__ #define __ASM_INLINE_GCC_H__ +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE #include @@ -266,4 +270,9 @@ static inline __attribute__((always_inline)) } #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* __ASM_INLINE_GCC_H__ */ diff --git a/include/arch/arc/v2/aux_regs.h b/include/arch/arc/v2/aux_regs.h index 7414ef336cd..71738b7f84b 100644 --- a/include/arch/arc/v2/aux_regs.h +++ b/include/arch/arc/v2/aux_regs.h @@ -25,6 +25,10 @@ #ifndef _ARC_V2_AUX_REGS__H_ #define _ARC_V2_AUX_REGS__H_ +#ifdef __cplusplus +extern "C" { +#endif + #define _ARC_V2_LP_START 0x002 #define _ARC_V2_LP_END 0x003 #define _ARC_V2_STATUS32 0x00a @@ -104,4 +108,8 @@ #endif /* __GNUC__ */ #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _ARC_V2_AUX_REGS__H_ */ diff --git a/include/arch/arc/v2/error.h b/include/arch/arc/v2/error.h index ce981fec46c..7eb01e94462 100644 --- a/include/arch/arc/v2/error.h +++ b/include/arch/arc/v2/error.h @@ -26,6 +26,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE #include extern FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int, @@ -38,4 +42,9 @@ extern void _SysFatalErrorHandler(unsigned int cause, const NANO_ESF *esf); #define _NANO_ERR_STACK_CHK_FAIL (2) /* Stack corruption detected */ #define _NANO_ERR_ALLOCATION_FAIL (3) /* Kernel Allocation Failure */ +#ifdef __cplusplus +} +#endif + + #endif /* _ARCH_ARC_V2_ERROR_H_ */ diff --git a/include/arch/arc/v2/exc.h b/include/arch/arc/v2/exc.h index b86d2fe1a8a..05ca9ffe605 100644 --- a/include/arch/arc/v2/exc.h +++ b/include/arch/arc/v2/exc.h @@ -24,6 +24,10 @@ #ifndef _ARCH_ARC_V2_EXC_H_ #define _ARCH_ARC_V2_EXC_H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE #else struct __esf { @@ -35,4 +39,9 @@ typedef struct __esf NANO_ESF; extern const NANO_ESF _default_esf; #endif +#ifdef __cplusplus +} +#endif + + #endif /* _ARCH_ARC_V2_EXC_H_ */ diff --git a/include/arch/arc/v2/ffs.h b/include/arch/arc/v2/ffs.h index fc0c1de351b..d5d4deeca16 100644 --- a/include/arch/arc/v2/ffs.h +++ b/include/arch/arc/v2/ffs.h @@ -24,6 +24,10 @@ #ifndef _ARCH_ARC_V2_FFS_H_ #define _ARCH_ARC_V2_FFS_H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE #include @@ -89,4 +93,8 @@ static ALWAYS_INLINE unsigned int find_lsb_set(uint32_t op) #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _ARCH_ARC_V2_FFS_H_ */ diff --git a/include/arch/arc/v2/irq.h b/include/arch/arc/v2/irq.h index 545f051ddeb..3429f8cbf1e 100644 --- a/include/arch/arc/v2/irq.h +++ b/include/arch/arc/v2/irq.h @@ -27,6 +27,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE GTEXT(_irq_exit); GTEXT(irq_connect) @@ -103,4 +107,9 @@ static ALWAYS_INLINE void irq_unlock(unsigned int key) } #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _ARCH_ARC_V2_IRQ__H_ */ diff --git a/include/arch/arc/v2/misc.h b/include/arch/arc/v2/misc.h index 40168d82e22..9aa2ff133c1 100644 --- a/include/arch/arc/v2/misc.h +++ b/include/arch/arc/v2/misc.h @@ -24,10 +24,18 @@ #ifndef _ARCH_ARC_V2_MISC_H_ #define _ARCH_ARC_V2_MISC_H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE extern unsigned int nano_cpu_sleep_mode; extern void nano_cpu_idle(void); extern void nano_cpu_atomic_idle(unsigned int key); #endif +#ifdef __cplusplus +} +#endif + #endif /* _ARCH_ARC_V2_MISC_H_ */ diff --git a/include/arch/arm/cortex_m/asm_inline_gcc.h b/include/arch/arm/cortex_m/asm_inline_gcc.h index 3479dff6ba8..04222575142 100644 --- a/include/arch/arm/cortex_m/asm_inline_gcc.h +++ b/include/arch/arm/cortex_m/asm_inline_gcc.h @@ -21,6 +21,10 @@ #ifndef _ASM_INLINE_GCC_PUBLIC_GCC_H #define _ASM_INLINE_GCC_PUBLIC_GCC_H +#ifdef __cplusplus +extern "C" { +#endif + /* * The file must not be included directly * Include arch/cpu.h instead @@ -170,4 +174,9 @@ static ALWAYS_INLINE void irq_unlock(unsigned int key) #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _ASM_INLINE_GCC_PUBLIC_GCC_H */ diff --git a/include/arch/arm/cortex_m/error.h b/include/arch/arm/cortex_m/error.h index cc4f820c090..0547cd8aa87 100644 --- a/include/arch/arm/cortex_m/error.h +++ b/include/arch/arm/cortex_m/error.h @@ -26,6 +26,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE extern FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int, const NANO_ESF*); @@ -37,4 +41,8 @@ extern void _SysFatalErrorHandler(unsigned int, const NANO_ESF*); #define _NANO_ERR_STACK_CHK_FAIL (2) /* Stack corruption detected */ #define _NANO_ERR_ALLOCATION_FAIL (3) /* Kernel Allocation Failure */ +#ifdef __cplusplus +} +#endif + #endif /* _ARCH_ARM_CORTEXM_ERROR_H_ */ diff --git a/include/arch/arm/cortex_m/exc.h b/include/arch/arm/cortex_m/exc.h index 740dd07c634..7e04e98f138 100644 --- a/include/arch/arm/cortex_m/exc.h +++ b/include/arch/arm/cortex_m/exc.h @@ -24,6 +24,10 @@ #ifndef _ARCH_ARM_CORTEXM_EXC_H_ #define _ARCH_ARM_CORTEXM_EXC_H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE GTEXT(_ExcExit); #else @@ -47,4 +51,8 @@ extern const NANO_ESF _default_esf; extern void _ExcExit(void); #endif +#ifdef __cplusplus +} +#endif + #endif /* _ARCH_ARM_CORTEXM_EXC_H_ */ diff --git a/include/arch/arm/cortex_m/gdb_stub.h b/include/arch/arm/cortex_m/gdb_stub.h index 9b3ec0cbf51..37c30ae6d69 100644 --- a/include/arch/arm/cortex_m/gdb_stub.h +++ b/include/arch/arm/cortex_m/gdb_stub.h @@ -27,6 +27,10 @@ #ifndef _GDB_STUB__H_ #define _GDB_STUB__H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE #if CONFIG_GDB_INFO @@ -58,4 +62,9 @@ GTEXT(_irq_vector_table_entry_with_gdb_stub) #else extern void _irq_vector_table_entry_with_gdb_stub(void); #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _GDB_STUB__H_ */ diff --git a/include/arch/arm/cortex_m/irq.h b/include/arch/arm/cortex_m/irq.h index b86b4e3339e..4901da97d56 100644 --- a/include/arch/arm/cortex_m/irq.h +++ b/include/arch/arm/cortex_m/irq.h @@ -27,6 +27,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE GTEXT(_IntExit); GTEXT(irq_connect_dynamic) @@ -98,4 +102,8 @@ extern void _irq_priority_set(unsigned int irq, unsigned int prio); #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _ARCH_ARM_CORTEXM_IRQ_H_ */ diff --git a/include/arch/arm/cortex_m/misc.h b/include/arch/arm/cortex_m/misc.h index 7ac6c536410..b5679c3c7d1 100644 --- a/include/arch/arm/cortex_m/misc.h +++ b/include/arch/arm/cortex_m/misc.h @@ -24,8 +24,16 @@ #ifndef _ARCH_ARM_CORTEXM_MISC_H_ #define _ARCH_ARM_CORTEXM_MISC_H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE extern void nano_cpu_idle(void); #endif +#ifdef __cplusplus +} +#endif + #endif /* _ARCH_ARM_CORTEXM_MISC_H_ */ diff --git a/include/arch/arm/cortex_m/nvic.h b/include/arch/arm/cortex_m/nvic.h index 0315c691367..a9d625ae981 100644 --- a/include/arch/arm/cortex_m/nvic.h +++ b/include/arch/arm/cortex_m/nvic.h @@ -39,6 +39,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* for assembler, only works with constants */ #define _EXC_PRIO(pri) (((pri) << (8 - CONFIG_NUM_IRQ_PRIO_BITS)) & 0xff) #if defined(CONFIG_ZERO_LATENCY_IRQS) @@ -221,4 +225,8 @@ static inline void _NvicSwInterruptTrigger(unsigned int irq) #endif /* !_ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _NVIC_H_ */ diff --git a/include/arch/arm/cortex_m/scb.h b/include/arch/arm/cortex_m/scb.h index f47b3b285b5..d787096d3bd 100644 --- a/include/arch/arm/cortex_m/scb.h +++ b/include/arch/arm/cortex_m/scb.h @@ -39,6 +39,10 @@ #ifndef _SCB__H_ #define _SCB__H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE /* needed by nano_cpu_atomic_idle() written in asm */ @@ -1203,4 +1207,8 @@ static inline void _ScbUsageFaultAllFaultsReset(void) } #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _SCB__H_ */ diff --git a/include/arch/arm/cortex_m/scs.h b/include/arch/arm/cortex_m/scs.h index 266cd160ac4..f3d63026d90 100644 --- a/include/arch/arm/cortex_m/scs.h +++ b/include/arch/arm/cortex_m/scs.h @@ -57,6 +57,10 @@ #ifndef _SCS__H_ #define _SCS__H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE #include @@ -557,4 +561,8 @@ static inline void _scs_relocate_vector_table(void *new_addr) #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _SCS__H_ */ diff --git a/include/arch/x86/arch.h b/include/arch/x86/arch.h index de75683b7e9..4ead9c8306d 100644 --- a/include/arch/x86/arch.h +++ b/include/arch/x86/arch.h @@ -29,6 +29,10 @@ #include #endif +#ifdef __cplusplus +extern "C" { +#endif + /* APIs need to support non-byte addressable architectures */ #define OCTET_TO_SIZEOFUNIT(X) (X) @@ -539,4 +543,8 @@ extern void _IntVecMarkFree(unsigned int vector); #define SYS_X86_RST_CNT_CPU_RST 0x4 #define SYS_X86_RST_CNT_FULL_RST 0x08 +#ifdef __cplusplus +} +#endif + #endif /* _ARCH_IFACE_H */ diff --git a/include/arch/x86/asm_inline_gcc.h b/include/arch/x86/asm_inline_gcc.h index 56331e613ec..7a949c9a2bb 100644 --- a/include/arch/x86/asm_inline_gcc.h +++ b/include/arch/x86/asm_inline_gcc.h @@ -28,6 +28,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE #include #include @@ -482,4 +486,9 @@ static inline __attribute__((always_inline)) } #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* _ASM_INLINE_GCC_PUBLIC_GCC_H */ diff --git a/include/bluetooth/bluetooth.h b/include/bluetooth/bluetooth.h index b1a7a624f2d..d52cdd6631d 100644 --- a/include/bluetooth/bluetooth.h +++ b/include/bluetooth/bluetooth.h @@ -26,6 +26,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** @brief Callback for notifying that Bluetooth has been enabled. * * @param err zero on success or (negative) error code otherwise. @@ -319,4 +323,9 @@ int bt_br_set_discoverable(bool enable); */ int bt_br_set_connectable(bool enable); #endif + +#ifdef __cplusplus +} +#endif + #endif /* __BT_BLUETOOTH_H */ diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index 52b9d49ca15..f6855b0cc67 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -20,6 +20,10 @@ #ifndef __BT_CONN_H #define __BT_CONN_H +#ifdef __cplusplus +extern "C" { +#endif + #if defined(CONFIG_BLUETOOTH_CENTRAL) || defined(CONFIG_BLUETOOTH_PERIPHERAL) #include @@ -350,4 +354,8 @@ int bt_conn_auth_pincode_entry(struct bt_conn *conn, const char *pin); #endif /* CONFIG_BLUETOOTH_BREDR */ #endif /* CONFIG_BLUETOOTH_SMP || CONFIG_BLUETOOTH_BREDR */ +#ifdef __cplusplus +} +#endif + #endif /* __BT_CONN_H */ diff --git a/include/bluetooth/driver.h b/include/bluetooth/driver.h index 4c4d2d029aa..c2c3d5597dd 100644 --- a/include/bluetooth/driver.h +++ b/include/bluetooth/driver.h @@ -35,6 +35,10 @@ struct net_buf *bt_buf_get_evt(void); /* Allocate a buffer for incoming ACL data */ struct net_buf *bt_buf_get_acl(void); +#ifdef __cplusplus +extern "C" { +#endif + /* Receive data from the controller/HCI driver */ void bt_recv(struct net_buf *buf); @@ -52,4 +56,8 @@ int bt_driver_register(struct bt_driver *drv); /* Unregister a previously registered HCI driver */ void bt_driver_unregister(struct bt_driver *drv); +#ifdef __cplusplus +} +#endif + #endif /* __BT_DRIVER_H */ diff --git a/include/bluetooth/gatt.h b/include/bluetooth/gatt.h index 5aa487567f1..5541d4653be 100644 --- a/include/bluetooth/gatt.h +++ b/include/bluetooth/gatt.h @@ -20,6 +20,10 @@ #ifndef __BT_GATT_H #define __BT_GATT_H +#ifdef __cplusplus +extern "C" { +#endif + #if defined(CONFIG_BLUETOOTH_CENTRAL) || defined(CONFIG_BLUETOOTH_PERIPHERAL) #include #include @@ -906,4 +910,9 @@ int bt_gatt_read_multiple(struct bt_conn *conn, const uint16_t *handles, #endif /* CONFIG_BLUETOOTH_GATT_CLIENT */ #endif /* CONFIG_BLUETOOTH_CENTRAL || CONFIG_BLUETOOTH_PERIPHERAL */ + +#ifdef __cplusplus +} +#endif + #endif /* __BT_GATT_H */ diff --git a/include/bluetooth/hci.h b/include/bluetooth/hci.h index 80eafde9c6f..5038c58fc6d 100644 --- a/include/bluetooth/hci.h +++ b/include/bluetooth/hci.h @@ -21,6 +21,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define BT_ADDR_LE_PUBLIC 0x00 #define BT_ADDR_LE_RANDOM 0x01 @@ -576,4 +580,8 @@ struct bt_hci_evt_le_generate_dhkey_complete { uint8_t dhkey[32]; } __packed; +#ifdef __cplusplus +} +#endif + #endif /* __BT_HCI_H */ diff --git a/include/bluetooth/l2cap.h b/include/bluetooth/l2cap.h index 8530e83e51c..3fdb02ab518 100644 --- a/include/bluetooth/l2cap.h +++ b/include/bluetooth/l2cap.h @@ -34,6 +34,10 @@ #ifndef __BT_L2CAP_H #define __BT_L2CAP_H +#ifdef __cplusplus +extern "C" { +#endif + #if defined(CONFIG_BLUETOOTH_CENTRAL) || defined(CONFIG_BLUETOOTH_PERIPHERAL) #include #include @@ -151,4 +155,9 @@ int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf); #endif /* CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL */ #endif /* CONFIG_BLUETOOTH_CENTRAL || CONFIG_BLUETOOTH_PERIPHERAL */ + +#ifdef __cplusplus +} +#endif + #endif /* __BT_L2CAP_H */ diff --git a/include/bluetooth/log.h b/include/bluetooth/log.h index a7e79eb6bf3..4a85e4d433c 100644 --- a/include/bluetooth/log.h +++ b/include/bluetooth/log.h @@ -22,6 +22,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #if defined(CONFIG_BLUETOOTH_DEBUG_COLOR) #define BT_COLOR_OFF "\x1B[0m" #define BT_COLOR_RED "\x1B[0;31m" @@ -59,4 +63,8 @@ #define BT_STACK_NOINIT(name, size) \ char __noinit __stack name[(size) + BT_STACK_DEBUG_EXTRA] +#ifdef __cplusplus +} +#endif + #endif /* __BT_LOG_H */ diff --git a/include/bluetooth/uuid.h b/include/bluetooth/uuid.h index 7a5b0970e12..46cbe6b5ca2 100644 --- a/include/bluetooth/uuid.h +++ b/include/bluetooth/uuid.h @@ -20,6 +20,10 @@ #ifndef __BT_UUID_H #define __BT_UUID_H +#ifdef __cplusplus +extern "C" { +#endif + /** @def BBT_UUID_GAP * @brief Generic Access */ @@ -233,4 +237,8 @@ void bt_uuid_to_str(const struct bt_uuid *uuid, char *str, size_t len); const char *bt_uuid_str(const struct bt_uuid *uuid); #endif /* CONFIG_BLUETOOTH_DEBUG */ +#ifdef __cplusplus +} +#endif + #endif /* __BT_UUID_H */ diff --git a/include/cache.h b/include/cache.h index dafec19620c..432ebb986b1 100644 --- a/include/cache.h +++ b/include/cache.h @@ -19,6 +19,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #if defined(CONFIG_CACHE_FLUSHING) #define _sys_cache_flush_sig(x) void (x)(vaddr_t virt, size_t size) @@ -36,4 +40,8 @@ #define sys_cache_line_size CONFIG_CACHE_LINE_SIZE #endif +#ifdef __cplusplus +} +#endif + #endif /* _cache__h_ */ diff --git a/include/device.h b/include/device.h index 49882f0cbe9..9659d453f7a 100644 --- a/include/device.h +++ b/include/device.h @@ -18,6 +18,10 @@ #ifndef _DEVICE_H_ #define _DEVICE_H_ +#ifdef __cplusplus +extern "C" { +#endif + /** @def DECLARE_DEVICE_INIT_CONFIG * * @brief Define an config object @@ -190,4 +194,8 @@ static inline void synchronous_call_complete(device_sync_call_t *sync) #endif /* CONFIG_MICROKERNEL || CONFIG_NANOKERNEL */ +#ifdef __cplusplus +} +#endif + #endif /* _DEVICE_H_ */ diff --git a/include/display/grove_lcd.h b/include/display/grove_lcd.h index 3d03ca69141..24abf8d5018 100644 --- a/include/display/grove_lcd.h +++ b/include/display/grove_lcd.h @@ -17,6 +17,10 @@ #ifndef DISPLAY_GROVE_LCD_H #define DISPLAY_GROVE_LCD_H +#ifdef __cplusplus +extern "C" { +#endif + #define GROVE_LCD_NAME "GLCD" /** @@ -162,4 +166,8 @@ void glcd_color_set(struct device *port, uint8_t r, uint8_t g, uint8_t b); */ int glcd_initialize(struct device *port); +#ifdef __cplusplus +} +#endif + #endif /* DISPLAY_GROVE_LCD_H */ diff --git a/include/drivers/console/ipm_console.h b/include/drivers/console/ipm_console.h index 8e8b507ee82..e4522235357 100644 --- a/include/drivers/console/ipm_console.h +++ b/include/drivers/console/ipm_console.h @@ -23,6 +23,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define IPM_CONSOLE_STDOUT (1 << 0) #define IPM_CONSOLE_PRINTK (1 << 1) @@ -99,4 +103,8 @@ int ipm_console_receiver_init(struct device *d); int ipm_console_sender_init(struct device *d); #endif +#ifdef __cplusplus +} +#endif + #endif /* _IPM_CONSOLE_H_ */ diff --git a/include/drivers/console/uart_pipe.h b/include/drivers/console/uart_pipe.h index 8183aa76085..3b7594ae9fd 100644 --- a/include/drivers/console/uart_pipe.h +++ b/include/drivers/console/uart_pipe.h @@ -23,6 +23,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** @brief Received data callback. * * This function is called when new data is received on UART. The off parameter @@ -66,3 +70,7 @@ int uart_pipe_send(const uint8_t *data, int len); * @param unused unused */ void uart_pipe_isr(void *unused); + +#ifdef __cplusplus +} +#endif diff --git a/include/drivers/k20_mcg.h b/include/drivers/k20_mcg.h index 6a1309fae01..7f60d866948 100644 --- a/include/drivers/k20_mcg.h +++ b/include/drivers/k20_mcg.h @@ -26,6 +26,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* MCG - module register structure */ typedef volatile struct { @@ -204,4 +208,8 @@ typedef union { /* Control register fields */ #define OSC_CR_EXT_CLK_EN 0x80 +#ifdef __cplusplus +} +#endif + #endif /* _K20MCG_H_ */ diff --git a/include/drivers/k20_pcr.h b/include/drivers/k20_pcr.h index fd836579b6e..3297756c900 100644 --- a/include/drivers/k20_pcr.h +++ b/include/drivers/k20_pcr.h @@ -27,6 +27,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define PCR_PORT_A 0 #define PCR_PORT_B 1 #define PCR_PORT_C 2 @@ -88,4 +92,8 @@ struct K20_PORT_PCR { #define K20_PCR(base, port, pin) \ ((union K20_PCR *)(base + (0x1000 * port) + (pin * 4))) +#ifdef __cplusplus +} +#endif + #endif /* _K20PCR_H_ */ diff --git a/include/drivers/k20_sim.h b/include/drivers/k20_sim.h index 36b0d77df07..b30fd499478 100644 --- a/include/drivers/k20_sim.h +++ b/include/drivers/k20_sim.h @@ -29,6 +29,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define SIM_OCS32K_SYS 0 #define SIM_OCS32K_RTS 2 #define SIM_OCS32K_LPO 3 /* 1kHz */ @@ -215,4 +219,8 @@ struct K20_SIM { uint8_t res104c_1063[0x1063 - 0x104c]; /* Reserved */ }; +#ifdef __cplusplus +} +#endif + #endif /* _K20SIM_H_ */ diff --git a/include/drivers/k20_watchdog.h b/include/drivers/k20_watchdog.h index 80caaa2e8b7..8df3c7e0387 100644 --- a/include/drivers/k20_watchdog.h +++ b/include/drivers/k20_watchdog.h @@ -26,6 +26,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Sequence of writes within 20 bus cycles for action to take effect */ #define WDOG_REFRESH_1 0xA602 #define WDOG_REFRESH_2 0xB480 @@ -135,4 +139,8 @@ static ALWAYS_INLINE void wdog_disable(volatile struct K20_WDOG *wdog_p) wdog_p->stctrlh.value = stctrlh.value; } +#ifdef __cplusplus +} +#endif + #endif /* _K20WDOG_H_ */ diff --git a/include/drivers/k6x_mpu.h b/include/drivers/k6x_mpu.h index 3b9db17023d..ea8c0bd40c8 100644 --- a/include/drivers/k6x_mpu.h +++ b/include/drivers/k6x_mpu.h @@ -29,6 +29,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define MPU_VALID_MASK 0x01 #define MPU_SLV_PORT_ERR_MASK 0xF8 @@ -68,4 +72,8 @@ struct K6x_MPU { uint32_t rgnDescAltAccCtrl[MPU_NUM_REGIONS]; /* 0x0800 */ }; /* K6x Microntroller PMC module */ +#ifdef __cplusplus +} +#endif + #endif /* _K6xMPU_H_ */ diff --git a/include/drivers/k6x_pmc.h b/include/drivers/k6x_pmc.h index 88eed057078..62efe1398cc 100644 --- a/include/drivers/k6x_pmc.h +++ b/include/drivers/k6x_pmc.h @@ -29,6 +29,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define PMC_REGSC_ACKISO_MASK 0x08 /* ack I/O isolation (write to clear) */ union REGSC { @@ -50,4 +54,8 @@ struct K6x_PMC { union REGSC regsc; /* 0x0002 */ }; /* K6x Microntroller PMC module */ +#ifdef __cplusplus +} +#endif + #endif /* _K6xPMC_H_ */ diff --git a/include/drivers/pci/pci.h b/include/drivers/pci/pci.h index 8f8f2c84d1a..f1d2a5f25c2 100644 --- a/include/drivers/pci/pci.h +++ b/include/drivers/pci/pci.h @@ -24,6 +24,10 @@ #ifndef _PCI_H_ #define _PCI_H_ +#ifdef __cplusplus +extern "C" { +#endif + #define BAR_SPACE_MEM 0 #define BAR_SPACE_IO 1 @@ -77,4 +81,8 @@ extern void pci_show(struct pci_dev_info *dev_info); #define pci_show(__unused__) { ; } #endif +#ifdef __cplusplus +} +#endif + #endif /* _PCI_H_ */ diff --git a/include/drivers/rand32.h b/include/drivers/rand32.h index 7ab3e2781c2..2027c27215d 100644 --- a/include/drivers/rand32.h +++ b/include/drivers/rand32.h @@ -34,7 +34,15 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + extern void sys_rand32_init(void); extern uint32_t sys_rand32_get(void); +#ifdef __cplusplus +} +#endif + #endif /* __INCrand32h */ diff --git a/include/drivers/serial/uart_nsim.h b/include/drivers/serial/uart_nsim.h index 1564a749b1a..01a2e93246d 100644 --- a/include/drivers/serial/uart_nsim.h +++ b/include/drivers/serial/uart_nsim.h @@ -23,6 +23,14 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + void uart_nsim_port_init(struct device *, const struct uart_init_info * const); +#ifdef __cplusplus +} +#endif + #endif /* _DRIVERS_UART_NSIM_H_ */ diff --git a/include/drivers/spi/spi_intel.h b/include/drivers/spi/spi_intel.h index 2722c3b2c2c..0e1ccb3b5dd 100644 --- a/include/drivers/spi/spi_intel.h +++ b/include/drivers/spi/spi_intel.h @@ -19,6 +19,10 @@ #ifndef __SPI_INTEL_H__ #define __SPI_INTEL_H__ +#ifdef __cplusplus +extern "C" { +#endif + /* SPI Maximum supported system frequencies */ #define SPI_MAX_CLK_FREQ_25MHZ ((0x800000 << 8)) #define SPI_MAX_CLK_FREQ_20MHz ((0x666666 << 8) | 1) @@ -52,5 +56,8 @@ #define SPI_MAX_CLK_FREQ_10KHZ ((0x20000 << 8) | 77) #define SPI_MAX_CLK_FREQ_5KHZ ((0x20000 << 8) | 154) #define SPI_MAX_CLK_FREQ_1KHZ ((0x8000 << 8) | 194) +#ifdef __cplusplus +} +#endif #endif /* __SPI_INTEL_H__ */ diff --git a/include/drivers/system_timer.h b/include/drivers/system_timer.h index b912ad854c9..3ddf8fc54ec 100644 --- a/include/drivers/system_timer.h +++ b/include/drivers/system_timer.h @@ -25,6 +25,10 @@ #ifndef _TIMER__H_ #define _TIMER__H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _ASMLANGUAGE GTEXT(_timer_int_handler) @@ -66,4 +70,8 @@ extern void _nano_sys_clock_tick_announce(int32_t ticks); #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _TIMER__H_ */ diff --git a/include/init.h b/include/init.h index 41c2966134a..9485a8ddaf5 100644 --- a/include/init.h +++ b/include/init.h @@ -21,6 +21,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* * System initialization levels. The PRIMARY and SECONDARY levels are * executed in the kernel's initialization context, which uses the interrupt @@ -116,4 +120,8 @@ */ #define SYS_GET_DEVICE(name) (&SYS_GET_DEVICE_NAME(name)) +#ifdef __cplusplus +} +#endif + #endif /* _INIT_H_ */ diff --git a/include/ipm.h b/include/ipm.h index 020cdb2c000..04df255a3b9 100644 --- a/include/ipm.h +++ b/include/ipm.h @@ -29,6 +29,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * Callback API for incoming IPM messages * @@ -168,6 +172,10 @@ static inline int ipm_set_enabled(struct device *ipmdev, int enable) return api->set_enabled(ipmdev, enable); } +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/include/irq_offload.h b/include/irq_offload.h index ada9e2ce258..25a9dfcbad7 100644 --- a/include/irq_offload.h +++ b/include/irq_offload.h @@ -20,6 +20,10 @@ #ifndef _IRQ_OFFLOAD_H_ #define _IRQ_OFFLOAD_H_ +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*irq_offload_routine_t)(void *parameter); /** @@ -36,4 +40,8 @@ typedef void (*irq_offload_routine_t)(void *parameter); */ void irq_offload(irq_offload_routine_t routine, void *parameter); +#ifdef __cplusplus +} +#endif + #endif /* _SW_IRQ_H_ */ diff --git a/include/kernel_version.h b/include/kernel_version.h index 6e9912e7f2d..9fdfec05576 100644 --- a/include/kernel_version.h +++ b/include/kernel_version.h @@ -19,6 +19,10 @@ #ifndef _kernel_version__h_ #define _kernel_version__h_ +#ifdef __cplusplus +extern "C" { +#endif + /* * The kernel version has been converted from a string to a four-byte * quantity that is divided into two parts. @@ -40,4 +44,8 @@ extern uint32_t sys_kernel_version_get(void); +#ifdef __cplusplus +} +#endif + #endif /* _kernel_version__h_ */ diff --git a/include/microkernel.h b/include/microkernel.h index b782074ee4d..7247baafe6a 100644 --- a/include/microkernel.h +++ b/include/microkernel.h @@ -19,6 +19,10 @@ #ifndef _MICROKERNEL_H #define _MICROKERNEL_H +#ifdef __cplusplus +extern "C" { +#endif + /* nanokernel and generic kernel public APIs */ #include @@ -57,4 +61,8 @@ * @} */ +#ifdef __cplusplus +} +#endif + #endif /* _MICROKERNEL_H */ diff --git a/include/microkernel/task_irq.h b/include/microkernel/task_irq.h index 72b7334c28d..53da4b09db8 100644 --- a/include/microkernel/task_irq.h +++ b/include/microkernel/task_irq.h @@ -29,6 +29,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define INVALID_VECTOR 0xFFFFFFFF /** @@ -83,4 +87,9 @@ extern int task_irq_wait(kirq_t irq_obj, int32_t timeout); /** * @} */ + +#ifdef __cplusplus +} +#endif + #endif /* TASK_IRQ_H */ diff --git a/include/misc/debug/mem_safe.h b/include/misc/debug/mem_safe.h index 8443300a053..bdc8be8697f 100644 --- a/include/misc/debug/mem_safe.h +++ b/include/misc/debug/mem_safe.h @@ -19,6 +19,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @file * @brief Safe memory access routines @@ -153,4 +157,8 @@ static inline int _mem_safe_region_add(void *addr, size_t num_bytes, } #endif +#ifdef __cplusplus +} +#endif + #endif /* _debug__mem_safe__h_ */ diff --git a/include/misc/dlist.h b/include/misc/dlist.h index 97bcf3dd3b1..e4924ae67b0 100644 --- a/include/misc/dlist.h +++ b/include/misc/dlist.h @@ -30,6 +30,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + struct _dnode { union { struct _dnode *head; /* ptr to head of list (sys_dlist_t) */ @@ -281,4 +285,8 @@ static inline sys_dnode_t *sys_dlist_get(sys_dlist_t *list) return node; } +#ifdef __cplusplus +} +#endif + #endif /* _misc_dlist__h_ */ diff --git a/include/misc/event_logger.h b/include/misc/event_logger.h index 0b02d9f56d1..1b28fdab664 100644 --- a/include/misc/event_logger.h +++ b/include/misc/event_logger.h @@ -22,6 +22,10 @@ #ifndef __EVENT_LOGGER_H__ #define __EVENT_LOGGER_H__ +#ifdef __cplusplus +extern "C" { +#endif + #define EVENT_HEADER_SIZE 1 #ifndef _ASMLANGUAGE @@ -149,4 +153,9 @@ int sys_event_logger_get_wait_timeout(struct event_logger *logger, #endif /* CONFIG_NANO_TIMEOUTS */ #endif /* _ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + #endif /* __EVENT_LOGGER_H__ */ diff --git a/include/misc/kernel_event_logger.h b/include/misc/kernel_event_logger.h index 38b1cb40865..6db022aa909 100644 --- a/include/misc/kernel_event_logger.h +++ b/include/misc/kernel_event_logger.h @@ -25,6 +25,10 @@ #ifndef __KERNEL_EVENT_LOGGER_H__ #define __KERNEL_EVENT_LOGGER_H__ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef CONFIG_KERNEL_EVENT_LOGGER #ifdef CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH @@ -200,4 +204,8 @@ static inline void _sys_k_event_logger_enter_sleep(void) {}; #endif /* CONFIG_KERNEL_EVENT_LOGGER */ +#ifdef __cplusplus +} +#endif + #endif /* __KERNEL_EVENT_LOGGER_H__ */ diff --git a/include/misc/printk.h b/include/misc/printk.h index ce3811cc3ea..1ed66553882 100644 --- a/include/misc/printk.h +++ b/include/misc/printk.h @@ -20,6 +20,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * * @brief Print kernel debugging message. @@ -53,4 +57,8 @@ static inline void printk(const char *fmt, ...) } #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/misc/reboot.h b/include/misc/reboot.h index ed6e277b812..3687b83e259 100644 --- a/include/misc/reboot.h +++ b/include/misc/reboot.h @@ -24,6 +24,10 @@ #ifndef _misc_reboot__h_ #define _misc_reboot__h_ +#ifdef __cplusplus +extern "C" { +#endif + #define SYS_REBOOT_WARM 0 #define SYS_REBOOT_COLD 1 @@ -40,4 +44,9 @@ */ extern void sys_reboot(int type); + +#ifdef __cplusplus +} +#endif + #endif /* _misc_reboot__h_ */ diff --git a/include/misc/ring_buffer.h b/include/misc/ring_buffer.h index 918d062af9e..5039a711eae 100644 --- a/include/misc/ring_buffer.h +++ b/include/misc/ring_buffer.h @@ -24,6 +24,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define SIZE32_OF(x) (sizeof((x))/sizeof(uint32_t)) /** @@ -165,4 +169,8 @@ int sys_ring_buf_put(struct ring_buf *buf, uint16_t type, uint8_t value, int sys_ring_buf_get(struct ring_buf *buf, uint16_t *type, uint8_t *value, uint32_t *data, uint8_t *size32); +#ifdef __cplusplus +} +#endif + #endif /* __RING_BUFFER_H__ */ diff --git a/include/misc/shell.h b/include/misc/shell.h index f5009e98e0c..25c663629bf 100644 --- a/include/misc/shell.h +++ b/include/misc/shell.h @@ -16,6 +16,10 @@ * limitations under the License. */ +#ifdef __cplusplus +extern "C" { +#endif + /** @brief Callback called when command is entered. * * @param argc Number of parameters passed. @@ -53,3 +57,8 @@ typedef const char *(*shell_prompt_function_t)(void); * @param handler To be called to get the current prompt. */ void shell_register_prompt_handler(shell_prompt_function_t handler); + +#ifdef __cplusplus +} +#endif + diff --git a/include/net/buf.h b/include/net/buf.h index 5eb6d32fac2..376cb89d20e 100644 --- a/include/net/buf.h +++ b/include/net/buf.h @@ -26,6 +26,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* Alignment needed for various parts of the buffer definition */ #define __net_buf_align __aligned(sizeof(int)) @@ -250,4 +254,8 @@ size_t net_buf_headroom(struct net_buf *buf); */ #define net_buf_tail(buf) ((buf)->data + (buf)->len) +#ifdef __cplusplus +} +#endif + #endif /* __NET_BUF_H */ diff --git a/include/net/ip_buf.h b/include/net/ip_buf.h index 1984bb78381..adc6d5df375 100644 --- a/include/net/ip_buf.h +++ b/include/net/ip_buf.h @@ -34,6 +34,10 @@ #include "contiki/ip/uip.h" #include "contiki/packetbuf.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifdef CONFIG_NETWORKING_WITH_LOGGING #undef DEBUG_IP_BUFS #define DEBUG_IP_BUFS @@ -374,4 +378,8 @@ static inline void net_analyze_stack(const char *name, #endif /* @endcond */ +#ifdef __cplusplus +} +#endif + #endif /* __IP_BUF_H */ diff --git a/include/net/l2_buf.h b/include/net/l2_buf.h index ebb086815d4..e8684cba698 100644 --- a/include/net/l2_buf.h +++ b/include/net/l2_buf.h @@ -35,6 +35,10 @@ #include "contiki/ip/uip.h" #include "contiki/packetbuf.h" +#ifdef __cplusplus +extern "C" { +#endif + #if defined(CONFIG_L2_BUFFERS) #ifdef CONFIG_NETWORKING_WITH_LOGGING @@ -147,4 +151,8 @@ void l2_buf_unref(struct net_buf *buf); #endif /* defined(CONFIG_L2_BUFFERS) */ +#ifdef __cplusplus +} +#endif + #endif /* __L2_BUF_H */ diff --git a/include/net/net_core.h b/include/net/net_core.h index 5cefe3b69ec..228f625a841 100644 --- a/include/net/net_core.h +++ b/include/net/net_core.h @@ -23,6 +23,10 @@ #ifndef __NET_CORE_H #define __NET_CORE_H +#ifdef __cplusplus +extern "C" { +#endif + /* Network subsystem logging helpers */ #define NET_DBG(fmt, ...) printk("net: %s: " fmt, __func__, ##__VA_ARGS__) @@ -125,4 +129,8 @@ int net_recv(struct net_buf *buf); void net_context_init(void); +#ifdef __cplusplus +} +#endif + #endif /* __NET_CORE_H */ diff --git a/include/net/net_ip.h b/include/net/net_ip.h index 2b50ddfec99..1d43c119639 100644 --- a/include/net/net_ip.h +++ b/include/net/net_ip.h @@ -25,6 +25,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** Protocol families */ #define PF_UNSPEC 0 /* Unspecified. */ #define PF_INET 2 /* IP protocol family. */ @@ -101,4 +105,8 @@ struct net_tuple { enum ip_protocol ip_proto; }; +#ifdef __cplusplus +} +#endif + #endif /* __NET_IP_H */ diff --git a/include/net/net_socket.h b/include/net/net_socket.h index 1d0a1c3a64a..5ff61b2d1d7 100644 --- a/include/net/net_socket.h +++ b/include/net/net_socket.h @@ -28,6 +28,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Get network context. * @@ -122,4 +126,8 @@ struct net_buf *net_receive(struct net_context *context, struct simple_udp_connection * net_context_get_udp_connection(struct net_context *context); +#ifdef __cplusplus +} +#endif + #endif /* __NET_SOCKET_H */ diff --git a/include/pinmux.h b/include/pinmux.h index 53f236529a4..b9687ede3d8 100644 --- a/include/pinmux.h +++ b/include/pinmux.h @@ -28,6 +28,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define PINMUX_NAME "pinmux" #define PINMUX_FUNC_A 0 @@ -94,8 +98,13 @@ static inline uint32_t pinmux_pin_input_enable(struct device *dev, return api->input(dev, pin, func); } +#ifdef __cplusplus +} +#endif + /** * * @} */ + #endif /* __INCLUDE_PINMUX_H */ diff --git a/include/rtc.h b/include/rtc.h index 775c5b669ea..8c8f73fff4a 100644 --- a/include/rtc.h +++ b/include/rtc.h @@ -20,6 +20,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + enum clk_rtc_div { RTC_CLK_DIV_1, RTC_CLK_DIV_2, @@ -125,4 +129,8 @@ static inline int rtc_set_alarm(struct device *dev, return api->set_alarm(dev, alarm_val); } +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/shared_irq.h b/include/shared_irq.h index e163bad6523..ab6b841ee53 100644 --- a/include/shared_irq.h +++ b/include/shared_irq.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef int (*isr_t)(struct device *dev); /* driver API definition */ @@ -97,4 +101,8 @@ static inline int shared_irq_disable(struct device *dev, struct device *isr_dev) return api->disable(dev, isr_dev); } +#ifdef __cplusplus +} +#endif + #endif /* _SHARED_IRQ_H_ */ diff --git a/include/sw_isr_table.h b/include/sw_isr_table.h index 5d7ca2774f6..8206231f6fd 100644 --- a/include/sw_isr_table.h +++ b/include/sw_isr_table.h @@ -24,6 +24,10 @@ #ifndef _SW_ISR_TABLE__H_ #define _SW_ISR_TABLE__H_ +#ifdef __cplusplus +extern "C" { +#endif + #if !defined(_ASMLANGUAGE) /* * Note the order: arg first, then ISR. This allows a table entry to be @@ -40,4 +44,8 @@ typedef struct _IsrTableEntry _IsrTableEntry_t; extern _IsrTableEntry_t _sw_isr_table[CONFIG_NUM_IRQS]; #endif /* _ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _SW_ISR_TABLE__H_ */ diff --git a/include/sys_clock.h b/include/sys_clock.h index 4d75a9c7a3e..733cf19d517 100644 --- a/include/sys_clock.h +++ b/include/sys_clock.h @@ -26,6 +26,10 @@ #ifndef _SYS_CLOCK__H_ #define _SYS_CLOCK__H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _ASMLANGUAGE #include @@ -99,4 +103,8 @@ extern struct nano_timer *_nano_timer_list; #endif /* !_ASMLANGUAGE */ +#ifdef __cplusplus +} +#endif + #endif /* _SYS_CLOCK__H_ */ diff --git a/include/watchdog.h b/include/watchdog.h index 09912d29843..4e707c91946 100644 --- a/include/watchdog.h +++ b/include/watchdog.h @@ -21,6 +21,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define WDT_MODE (BIT(1)) #define WDT_MODE_OFFSET (1) #define WDT_TIMEOUT_MASK (0xF) @@ -120,4 +124,8 @@ static inline void wdt_reload(struct device *dev) api->reload(dev); } +#ifdef __cplusplus +} +#endif + #endif diff --git a/kernel/microkernel/include/k_pipe_util.h b/kernel/microkernel/include/k_pipe_util.h index 3b610e15207..23ddf1b4609 100644 --- a/kernel/microkernel/include/k_pipe_util.h +++ b/kernel/microkernel/include/k_pipe_util.h @@ -35,6 +35,9 @@ typedef uint32_t TIME_TYPE; #define _TIME_B ((TIME_TYPE)0x00020000) #define _TIME_BT ((TIME_TYPE)0x00040000) +#ifdef __cplusplus +extern "C" { +#endif extern void _k_pipe_process(struct _k_pipe_struct *pipe_ptr, struct k_args *writer_ptr, struct k_args *reader_ptr); @@ -58,4 +61,8 @@ void _k_pipe_request_status_set(struct _pipe_xfer_req_arg *pipe_xfer_req, TIME_TYPE _k_pipe_time_type_get(K_ARGS_ARGS *args); void _k_pipe_time_type_set(K_ARGS_ARGS *args, TIME_TYPE TimeType); +#ifdef __cplusplus +} +#endif + #endif /* _K_PIPE_UTIL_H */ diff --git a/kernel/microkernel/include/micro_private.h b/kernel/microkernel/include/micro_private.h index 2d485adeedc..f23c61389f1 100644 --- a/kernel/microkernel/include/micro_private.h +++ b/kernel/microkernel/include/micro_private.h @@ -24,6 +24,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* * The 2 least significant bits of the commands placed on the microkernel * server's command stack identify the type of command; the remaining bits @@ -219,4 +223,8 @@ extern void _k_workload_monitor_idle_end(void); #define SENDARGS(A) nano_fiber_stack_push(&_k_command_stack, (uint32_t)(A)) +#ifdef __cplusplus +} +#endif + #endif diff --git a/kernel/nanokernel/include/timeout_q.h b/kernel/nanokernel/include/timeout_q.h index 8316e0168d9..c19e8588e8c 100644 --- a/kernel/nanokernel/include/timeout_q.h +++ b/kernel/nanokernel/include/timeout_q.h @@ -25,6 +25,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* initialize the nano timeouts part of TCS when enabled in the kernel */ static inline void _nano_timeout_tcs_init(struct tcs *tcs) @@ -150,4 +154,8 @@ static inline uint32_t _nano_get_earliest_timeouts_deadline(void) return t ? t->delta_ticks_from_prev : TICKS_UNLIMITED; } +#ifdef __cplusplus +} +#endif + #endif /* _kernel_nanokernel_include_timeout_q__h_ */ diff --git a/kernel/nanokernel/include/wait_q.h b/kernel/nanokernel/include/wait_q.h index 03b7096c99a..4f4befbbfd3 100644 --- a/kernel/nanokernel/include/wait_q.h +++ b/kernel/nanokernel/include/wait_q.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* reset a wait queue, call during operation */ static inline void _nano_wait_q_reset(struct _nano_queue *wait_q) { @@ -112,4 +116,8 @@ static inline void _nano_timeout_remove_tcs_from_wait_q(struct tcs *tcs) #define _NANO_TIMEOUT_ADD(pq, ticks) do { } while (0) #endif +#ifdef __cplusplus +} +#endif + #endif /* _kernel_nanokernel_include_wait_q__h_ */ diff --git a/lib/crypto/tinycrypt/include/tinycrypt/aes.h b/lib/crypto/tinycrypt/include/tinycrypt/aes.h index 41daed97241..fbfa9c93468 100644 --- a/lib/crypto/tinycrypt/include/tinycrypt/aes.h +++ b/lib/crypto/tinycrypt/include/tinycrypt/aes.h @@ -51,6 +51,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define Nb (4) /* number of columns (32-bit words) comprising the state */ #define Nk (4) /* number of 32-bit words comprising the key */ #define Nr (10) /* number of rounds */ @@ -122,4 +126,8 @@ int32_t tc_aes_decrypt(uint8_t *out, const uint8_t *in, const TCAesKeySched_t s); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/crypto/tinycrypt/include/tinycrypt/cbc_mode.h b/lib/crypto/tinycrypt/include/tinycrypt/cbc_mode.h index 589e9dcbe3e..1c0c1887e26 100644 --- a/lib/crypto/tinycrypt/include/tinycrypt/cbc_mode.h +++ b/lib/crypto/tinycrypt/include/tinycrypt/cbc_mode.h @@ -76,6 +76,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief CBC encryption procedure * CBC encrypts inlen bytes of the in buffer into the out buffer @@ -140,4 +144,8 @@ int32_t tc_cbc_mode_decrypt(uint8_t *out, uint32_t outlen, const uint8_t *in, uint32_t inlen, const uint8_t *iv, const TCAesKeySched_t sched); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/crypto/tinycrypt/include/tinycrypt/ctr_mode.h b/lib/crypto/tinycrypt/include/tinycrypt/ctr_mode.h index e572a573a15..312a42ba22e 100644 --- a/lib/crypto/tinycrypt/include/tinycrypt/ctr_mode.h +++ b/lib/crypto/tinycrypt/include/tinycrypt/ctr_mode.h @@ -69,6 +69,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief CTR mode encryption/decryption procedure. * CTR mode encrypts (or decrypts) inlen bytes from in buffer into out buffer @@ -96,4 +100,8 @@ int32_t tc_ctr_mode(uint8_t *out, uint32_t outlen, const uint8_t *in, uint32_t inlen, uint8_t *ctr, const TCAesKeySched_t sched); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/crypto/tinycrypt/include/tinycrypt/hmac.h b/lib/crypto/tinycrypt/include/tinycrypt/hmac.h index fa7f2797f91..23541eddef2 100644 --- a/lib/crypto/tinycrypt/include/tinycrypt/hmac.h +++ b/lib/crypto/tinycrypt/include/tinycrypt/hmac.h @@ -65,6 +65,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + struct tc_hmac_state_struct { /* the internal state required by h */ struct tc_sha256_state_struct hash_state; @@ -129,4 +133,8 @@ int32_t tc_hmac_update(TCHmacState_t ctx, */ int32_t tc_hmac_final(uint8_t *tag, uint32_t taglen, TCHmacState_t ctx); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/crypto/tinycrypt/include/tinycrypt/hmac_prng.h b/lib/crypto/tinycrypt/include/tinycrypt/hmac_prng.h index e06cfeb236e..b1af68740ec 100644 --- a/lib/crypto/tinycrypt/include/tinycrypt/hmac_prng.h +++ b/lib/crypto/tinycrypt/include/tinycrypt/hmac_prng.h @@ -71,6 +71,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + struct tc_hmac_prng_struct { /* the HMAC instance for this PRNG */ struct tc_hmac_state_struct h; @@ -151,4 +155,8 @@ int32_t tc_hmac_prng_reseed(TCHmacPrng_t prng, const uint8_t *seed, */ int32_t tc_hmac_prng_generate(uint8_t *out, uint32_t outlen, TCHmacPrng_t prng); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/crypto/tinycrypt/include/tinycrypt/sha256.h b/lib/crypto/tinycrypt/include/tinycrypt/sha256.h index f98074400b4..92f0f61d0b3 100644 --- a/lib/crypto/tinycrypt/include/tinycrypt/sha256.h +++ b/lib/crypto/tinycrypt/include/tinycrypt/sha256.h @@ -60,6 +60,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define TC_SHA256_BLOCK_SIZE (64) #define TC_SHA256_DIGEST_SIZE (32) #define TC_SHA256_STATE_BLOCKS (TC_SHA256_DIGEST_SIZE/4) @@ -120,4 +124,8 @@ int32_t tc_sha256_update(TCSha256State_t s, */ int32_t tc_sha256_final(uint8_t *digest, TCSha256State_t s); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/crypto/tinycrypt/include/tinycrypt/utils.h b/lib/crypto/tinycrypt/include/tinycrypt/utils.h index dbeeb3e1c87..3ed29d7c844 100644 --- a/lib/crypto/tinycrypt/include/tinycrypt/utils.h +++ b/lib/crypto/tinycrypt/include/tinycrypt/utils.h @@ -41,6 +41,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define TC_SUCCESS 1 #define TC_FAIL 0 #define TC_RESEED_REQ -1 @@ -65,4 +69,8 @@ void _set(uint8_t *to, uint8_t val, uint32_t len); */ uint8_t _double_byte(uint8_t a); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/libc/minimal/include/ctype.h b/lib/libc/minimal/include/ctype.h index db468714fdc..5c0d471584c 100644 --- a/lib/libc/minimal/include/ctype.h +++ b/lib/libc/minimal/include/ctype.h @@ -19,6 +19,10 @@ #ifndef __INC_ctype_h__ #define __INC_ctype_h__ +#ifdef __cplusplus +extern "C" { +#endif + static inline int isupper(int a) { return ((unsigned)(a)-'A') < 26; @@ -66,4 +70,8 @@ static inline int toupper(int chr) return (chr >= 'a' && chr <= 'z') ? (chr - 32) : (chr); } +#ifdef __cplusplus +} +#endif + #endif /* __INC_ctype_h__ */ diff --git a/lib/libc/minimal/include/limits.h b/lib/libc/minimal/include/limits.h index 79d777efcee..6c783761094 100644 --- a/lib/libc/minimal/include/limits.h +++ b/lib/libc/minimal/include/limits.h @@ -19,6 +19,10 @@ #ifndef __INC_limits_h__ #define __INC_limits_h__ +#ifdef __cplusplus +extern "C" { +#endif + #define UCHAR_MAX 0xFF #define SCHAR_MAX 0x7F #define SCHAR_MIN (-SCHAR_MAX - 1) @@ -54,4 +58,8 @@ #define ULONG_MAX 0xFFFFFFFFul #define ULLONG_MAX 0xFFFFFFFFFFFFFFFFull +#ifdef __cplusplus +} +#endif + #endif /* __INC_limits_h__ */ diff --git a/lib/libc/minimal/include/stdint.h b/lib/libc/minimal/include/stdint.h index c0059b96bd0..2e4deb5da52 100644 --- a/lib/libc/minimal/include/stdint.h +++ b/lib/libc/minimal/include/stdint.h @@ -19,6 +19,10 @@ #ifndef __INC_stdint_h__ #define __INC_stdint_h__ +#ifdef __cplusplus +extern "C" { +#endif + #define INT8_MAX 0x7F #define INT16_MAX 0x7FFF #define INT32_MAX 0x7FFFFFFF @@ -56,4 +60,8 @@ typedef unsigned long long uint64_t; typedef int intptr_t; typedef unsigned int uintptr_t; +#ifdef __cplusplus +} +#endif + #endif /* __INC_stdint_h__ */ diff --git a/lib/libc/minimal/include/stdio.h b/lib/libc/minimal/include/stdio.h index e7c4ad2b690..711692d14b6 100644 --- a/lib/libc/minimal/include/stdio.h +++ b/lib/libc/minimal/include/stdio.h @@ -21,6 +21,10 @@ #include /* Needed to get definition of va_list */ +#ifdef __cplusplus +extern "C" { +#endif + #if !defined(__size_t_defined) #define __size_t_defined typedef unsigned int size_t; @@ -65,4 +69,8 @@ int fputc(int c, FILE *stream); int fputs(const char *restrict s, FILE *restrict stream); size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream); +#ifdef __cplusplus +} +#endif + #endif /* __INC_stdio_h__ */ diff --git a/lib/libc/minimal/include/stdlib.h b/lib/libc/minimal/include/stdlib.h index 652e2f8f99a..dcddb956341 100644 --- a/lib/libc/minimal/include/stdlib.h +++ b/lib/libc/minimal/include/stdlib.h @@ -25,6 +25,10 @@ #define NULL (void *) 0 #endif +#ifdef __cplusplus +extern "C" { +#endif + #if !defined(__size_t_defined) #define __size_t_defined typedef unsigned int size_t; @@ -34,5 +38,8 @@ unsigned long int strtoul(const char *str, char **endptr, int base); long int strtol(const char *str, char **endptr, int base); int atoi(const char *s); +#ifdef __cplusplus +} +#endif #endif /* __INC_stdlib_h__ */ diff --git a/lib/libc/minimal/include/string.h b/lib/libc/minimal/include/string.h index 3960e5a3f36..e4d34a7e174 100644 --- a/lib/libc/minimal/include/string.h +++ b/lib/libc/minimal/include/string.h @@ -23,6 +23,10 @@ #define NULL (void *) 0 #endif +#ifdef __cplusplus +extern "C" { +#endif + #if !defined(__size_t_defined) #define __size_t_defined typedef unsigned int size_t; @@ -42,4 +46,8 @@ extern void *memcpy(void *restrict d, const void *restrict s, size_t n); extern void *memset(void *buf, int c, size_t n); extern void *memchr(const void *s, unsigned char c, size_t n); +#ifdef __cplusplus +} +#endif + #endif /* __INC_string_h__ */ diff --git a/lib/libc/minimal/include/strings.h b/lib/libc/minimal/include/strings.h index e14624ccafc..78b0e9f0eb1 100644 --- a/lib/libc/minimal/include/strings.h +++ b/lib/libc/minimal/include/strings.h @@ -19,6 +19,14 @@ #ifndef __INC_strings_h__ #define __INC_strings_h__ +#ifdef __cplusplus +extern "C" { +#endif + extern int strncasecmp(const char *s1, const char *s2, size_t n); +#ifdef __cplusplus +} +#endif + #endif /* __INC_strings_h__ */