From de3c3cebd01f4844ae8e0a16f542f372de548f22 Mon Sep 17 00:00:00 2001 From: BytesGalore Date: Fri, 10 Oct 2014 11:51:11 +0200 Subject: [PATCH] c++: sys: add extern C to header files --- sys/include/auto_init.h | 8 ++++++++ sys/include/bloom.h | 8 ++++++++ sys/include/board_uart0.h | 8 ++++++++ sys/include/cbor.h | 9 +++++++++ sys/include/chardev_thread.h | 8 ++++++++ sys/include/color.h | 8 ++++++++ sys/include/crypto/3des.h | 8 ++++++++ sys/include/crypto/aes.h | 7 +++++++ sys/include/crypto/cbcmode.h | 8 ++++++++ sys/include/crypto/ciphers.h | 8 ++++++++ sys/include/crypto/rc5.h | 7 +++++++ sys/include/crypto/sha256.h | 8 ++++++++ sys/include/crypto/skipjack.h | 8 ++++++++ sys/include/crypto/twofish.h | 8 ++++++++ sys/include/fd.h | 8 ++++++++ sys/include/hash_string.h | 8 ++++++++ sys/include/hashes.h | 8 ++++++++ sys/include/ping.h | 8 ++++++++ sys/include/pipe.h | 8 ++++++++ sys/include/posix_io.h | 8 ++++++++ sys/include/ps.h | 8 ++++++++ sys/include/radio/radio.h | 8 ++++++++ sys/include/radio/types.h | 8 ++++++++ sys/include/random.h | 8 ++++++++ sys/include/ringbuffer.h | 8 ++++++++ sys/include/shell.h | 8 ++++++++ sys/include/shell_commands.h | 8 ++++++++ sys/include/timex.h | 8 ++++++++ sys/include/tm.h | 8 ++++++++ sys/include/transceiver.h | 8 ++++++++ sys/include/vtimer.h | 8 ++++++++ sys/net/ccn_lite/ccnl-core.h | 8 ++++++++ sys/net/ccn_lite/ccnl-ext.h | 8 ++++++++ sys/net/ccn_lite/ccnl-includes.h | 8 ++++++++ sys/net/ccn_lite/ccnl-pdu.h | 8 ++++++++ sys/net/ccn_lite/ccnl-platform.h | 8 ++++++++ sys/net/ccn_lite/ccnl-riot-compat.h | 8 ++++++++ sys/net/ccn_lite/ccnl.h | 8 ++++++++ sys/net/ccn_lite/ccnx.h | 8 ++++++++ sys/net/ccn_lite/util/ccn-lite-ctrl.h | 8 ++++++++ sys/net/include/ccn_lite/ccnl-riot.h | 8 ++++++++ sys/net/include/ccn_lite/test_data/text.txt.ccnb.h | 8 ++++++++ sys/net/include/ccn_lite/util/ccnl-riot-client.h | 8 ++++++++ sys/net/include/etx_beaconing.h | 8 ++++++++ sys/net/include/ieee802154_frame.h | 8 ++++++++ sys/net/include/inet_ntop.h | 8 ++++++++ sys/net/include/inet_pton.h | 8 ++++++++ sys/net/include/ipv6.h | 8 ++++++++ sys/net/include/net_help.h | 8 ++++++++ sys/net/include/net_if.h | 8 ++++++++ sys/net/include/pktbuf.h | 8 ++++++++ sys/net/include/pktqueue.h | 8 ++++++++ sys/net/include/protocol-multiplex.h | 8 ++++++++ sys/net/include/rpl.h | 8 ++++++++ sys/net/include/rpl/rpl_config.h | 8 ++++++++ sys/net/include/rpl/rpl_dodag.h | 8 ++++++++ sys/net/include/rpl/rpl_storing.h | 8 ++++++++ sys/net/include/rpl/rpl_structs.h | 9 +++++++++ sys/net/include/sixlowpan.h | 8 ++++++++ sys/net/include/sixlowpan/error.h | 8 ++++++++ sys/net/include/sixlowpan/icmp.h | 9 +++++++++ sys/net/include/sixlowpan/ip.h | 8 ++++++++ sys/net/include/sixlowpan/lowpan.h | 8 ++++++++ sys/net/include/sixlowpan/mac.h | 8 ++++++++ sys/net/include/sixlowpan/ndp.h | 8 ++++++++ sys/net/include/sixlowpan/types.h | 8 ++++++++ sys/net/include/socket_base.h | 8 ++++++++ sys/net/include/socket_base/in.h | 8 ++++++++ sys/net/include/socket_base/socket.h | 8 ++++++++ sys/net/include/socket_base/types.h | 8 ++++++++ sys/net/include/tcp.h | 8 ++++++++ sys/net/include/udp.h | 8 ++++++++ sys/net/network_layer/sixlowpan/border/border.h | 8 ++++++++ .../network_layer/sixlowpan/border/bordermultiplex.h | 8 ++++++++ sys/net/network_layer/sixlowpan/border/flowcontrol.h | 8 ++++++++ sys/net/network_layer/sixlowpan/icmp.h | 9 +++++++++ sys/net/network_layer/sixlowpan/ip.h | 8 ++++++++ sys/net/network_layer/sixlowpan/lowpan.h | 8 ++++++++ sys/net/network_layer/sixlowpan/serialnumber.h | 8 ++++++++ sys/net/routing/rpl/of0.h | 8 ++++++++ sys/net/routing/rpl/of_mrhof.h | 8 ++++++++ sys/net/routing/rpl/trickle.h | 8 ++++++++ sys/net/transport_layer/socket_base/msg_help.h | 8 ++++++++ sys/net/transport_layer/socket_base/socket.h | 8 ++++++++ sys/net/transport_layer/tcp/tcp.h | 8 ++++++++ sys/net/transport_layer/tcp/tcp_hc.h | 9 +++++++++ sys/net/transport_layer/tcp/tcp_timer.h | 8 ++++++++ sys/net/transport_layer/udp/udp.h | 8 ++++++++ sys/oneway-malloc/include/malloc.h | 8 ++++++++ sys/posix/include/semaphore.h | 12 ++++++++++-- sys/posix/include/strings.h | 8 ++++++++ sys/posix/include/unistd.h | 8 ++++++++ sys/posix/pnet/include/arpa/inet.h | 8 ++++++++ sys/posix/pnet/include/netinet/in.h | 8 ++++++++ sys/posix/pnet/include/sys/socket.h | 8 ++++++++ sys/posix/pthread/include/pthread.h | 8 ++++++++ sys/posix/pthread/include/pthread_barrier.h | 8 ++++++++ sys/posix/pthread/include/pthread_cancellation.h | 8 ++++++++ sys/posix/pthread/include/pthread_cleanup.h | 8 ++++++++ sys/posix/pthread/include/pthread_cond.h | 8 ++++++++ sys/posix/pthread/include/pthread_mutex.h | 8 ++++++++ sys/posix/pthread/include/pthread_mutex_attr.h | 8 ++++++++ sys/posix/pthread/include/pthread_once.h | 8 ++++++++ sys/posix/pthread/include/pthread_rwlock.h | 8 ++++++++ sys/posix/pthread/include/pthread_rwlock_attr.h | 8 ++++++++ sys/posix/pthread/include/pthread_scheduling.h | 8 ++++++++ sys/posix/pthread/include/pthread_spin.h | 8 ++++++++ sys/posix/pthread/include/pthread_threading.h | 8 ++++++++ sys/posix/pthread/include/pthread_threading_attr.h | 8 ++++++++ sys/quad_math/quad.h | 9 +++++++++ 110 files changed, 886 insertions(+), 2 deletions(-) diff --git a/sys/include/auto_init.h b/sys/include/auto_init.h index 48868200fc..3d6e804ee7 100644 --- a/sys/include/auto_init.h +++ b/sys/include/auto_init.h @@ -32,7 +32,15 @@ #ifndef AUTO_INIT_H #define AUTO_INIT_H +#ifdef __cplusplus +extern "C" { +#endif + void auto_init(void); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* AUTO_INIT_H */ diff --git a/sys/include/bloom.h b/sys/include/bloom.h index b761e42dd5..25718988a9 100644 --- a/sys/include/bloom.h +++ b/sys/include/bloom.h @@ -127,6 +127,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * hashfp_t hash function to use in thee filter */ @@ -215,5 +219,9 @@ void bloom_add(bloom_t *bloom, const uint8_t *buf, size_t len); */ bool bloom_check(bloom_t *bloom, const uint8_t *buf, size_t len); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* _BLOOM_FILTER_H */ diff --git a/sys/include/board_uart0.h b/sys/include/board_uart0.h index 9debe572ef..134c6503c0 100644 --- a/sys/include/board_uart0.h +++ b/sys/include/board_uart0.h @@ -23,6 +23,10 @@ #include "kernel_types.h" #include "cpu-conf.h" /* To give user access to UART0_BUFSIZE */ +#ifdef __cplusplus +extern "C" { +#endif + extern kernel_pid_t uart0_handler_pid; void board_uart0_init(void); @@ -32,5 +36,9 @@ void uart0_notify_thread(void); int uart0_readc(void); void uart0_putc(int c); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* __BOARD_UART0_H */ diff --git a/sys/include/cbor.h b/sys/include/cbor.h index 7a6d0c7b08..927e8d6dd7 100644 --- a/sys/include/cbor.h +++ b/sys/include/cbor.h @@ -99,10 +99,15 @@ #include #include #include + #ifndef CBOR_NO_CTIME #include #endif /* CBOR_NO_CTIME */ +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Struct containing CBOR-encoded data * @@ -363,6 +368,10 @@ bool cbor_at_break(const cbor_stream_t *s, size_t offset); */ bool cbor_at_end(const cbor_stream_t *s, size_t offset); +#ifdef __cplusplus +} +#endif + #endif /** @} */ diff --git a/sys/include/chardev_thread.h b/sys/include/chardev_thread.h index e74ed038bd..6921c114fa 100644 --- a/sys/include/chardev_thread.h +++ b/sys/include/chardev_thread.h @@ -18,7 +18,15 @@ #include "ringbuffer.h" +#ifdef __cplusplus +extern "C" { +#endif + void chardev_loop(ringbuffer_t *rb); void *chardev_thread_entry(void *rb_); +#ifdef __cplusplus +} +#endif + #endif /* __CHARDEV_THREAD_H */ diff --git a/sys/include/color.h b/sys/include/color.h index 304fd51211..4188b150d5 100644 --- a/sys/include/color.h +++ b/sys/include/color.h @@ -23,6 +23,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Data-structure describing a RGB color */ @@ -58,5 +62,9 @@ void color_rgb2hsv(color_rgb_t *rgb, color_hsv_t *hsv); */ void color_hsv2rgb(color_hsv_t *hsv, color_rgb_t *rgb); +#ifdef __cplusplus +} +#endif + #endif /* __COLOR_H */ /** @} */ diff --git a/sys/include/crypto/3des.h b/sys/include/crypto/3des.h index f30ef2d83c..173c8e4163 100644 --- a/sys/include/crypto/3des.h +++ b/sys/include/crypto/3des.h @@ -29,6 +29,10 @@ #ifndef THREEDES_H_ #define THREEDES_H_ +#ifdef __cplusplus +extern "C" { +#endif + #define THREEDES_BLOCK_SIZE 8 #define THREEDES_KEY_SIZE PARSEC_KEYSIZE @@ -148,5 +152,9 @@ uint8_t tripledes_get_preferred_block_size(void); */ extern block_cipher_interface_t tripledes_interface; +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* THREEDES_H_ */ diff --git a/sys/include/crypto/aes.h b/sys/include/crypto/aes.h index 77acb457a2..2e057bee35 100644 --- a/sys/include/crypto/aes.h +++ b/sys/include/crypto/aes.h @@ -29,6 +29,9 @@ #include #include "crypto/ciphers.h" +#ifdef __cplusplus +extern "C" { +#endif typedef uint32_t u32; typedef uint16_t u16; @@ -138,5 +141,9 @@ uint8_t aes_get_preferred_block_size(void); */ extern block_cipher_interface_t aes_inerface; +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* AES_H */ diff --git a/sys/include/crypto/cbcmode.h b/sys/include/crypto/cbcmode.h index 4b01b01a76..1880861de7 100644 --- a/sys/include/crypto/cbcmode.h +++ b/sys/include/crypto/cbcmode.h @@ -31,6 +31,10 @@ #include "crypto/ciphers.h" +#ifdef __cplusplus +extern "C" { +#endif + #define MIN(a, b) ( ((a) < (b)) ? (a) : (b)) #define DBG_CRYPTO 1 @@ -204,5 +208,9 @@ int block_cipher_mode_decrypt(CipherModeContext *context, uint16_t num_bytes, uint8_t *IV); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* CBCMODE_H_ */ diff --git a/sys/include/crypto/ciphers.h b/sys/include/crypto/ciphers.h index e4353c63bb..fe0cd70556 100644 --- a/sys/include/crypto/ciphers.h +++ b/sys/include/crypto/ciphers.h @@ -22,6 +22,10 @@ #ifndef __CIPHERS_H_ #define __CIPHERS_H_ +#ifdef __cplusplus +extern "C" { +#endif + /* Shared header file for all cipher algorithms */ /* Set the algorithms that should be compiled in here. When these defines @@ -119,5 +123,9 @@ typedef struct { #endif } cipher_mac_context_t; +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* __CIPHERS_H_ */ diff --git a/sys/include/crypto/rc5.h b/sys/include/crypto/rc5.h index 0b3a491f78..dffb9aeb56 100644 --- a/sys/include/crypto/rc5.h +++ b/sys/include/crypto/rc5.h @@ -23,6 +23,9 @@ #ifndef RC5_H_ #define RC5_H_ +#ifdef __cplusplus +extern "C" { +#endif #define RC5_32_P 0xB7E15163L #define RC5_32_Q 0x9E3779B9L @@ -137,5 +140,9 @@ uint8_t rc5_get_preferred_block_size(void); */ extern block_cipher_interface_t rc5_interface; +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* RC5_H_ */ diff --git a/sys/include/crypto/sha256.h b/sys/include/crypto/sha256.h index 62bbbdeaf4..5b4395e803 100644 --- a/sys/include/crypto/sha256.h +++ b/sys/include/crypto/sha256.h @@ -51,6 +51,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define SHA256_DIGEST_LENGTH 32 typedef struct { @@ -96,5 +100,9 @@ void sha256_final(unsigned char digest[32], sha256_context_t *ctx); */ unsigned char *sha256(const unsigned char *d, size_t n, unsigned char *md); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* _SHA256_H_ */ diff --git a/sys/include/crypto/skipjack.h b/sys/include/crypto/skipjack.h index 6b287374bf..034ad959c2 100644 --- a/sys/include/crypto/skipjack.h +++ b/sys/include/crypto/skipjack.h @@ -23,6 +23,10 @@ #include "crypto/ciphers.h" +#ifdef __cplusplus +extern "C" { +#endif + #define F(addr) /*CRYPTO_TABLE_ACCESS( &SJ_F[addr])*/ (SJ_F[addr]) // G-Permutation: 4 round feistel structure @@ -167,5 +171,9 @@ uint8_t skipjack_get_preferred_block_size(void); */ extern block_cipher_interface_t skipjack_interface; +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* SKIPJACK_H_ */ diff --git a/sys/include/crypto/twofish.h b/sys/include/crypto/twofish.h index 087eb87c3f..d7fa9750b2 100644 --- a/sys/include/crypto/twofish.h +++ b/sys/include/crypto/twofish.h @@ -28,6 +28,10 @@ #ifndef TWOFISH_H_ #define TWOFISH_H_ +#ifdef __cplusplus +extern "C" { +#endif + #define TWOFISH_BLOCK_SIZE 16 #define TWOFISH_KEY_SIZE 16 //only alternative is 32! @@ -278,5 +282,9 @@ uint8_t twofish_get_preferred_block_size(void); */ extern block_cipher_interface_t twofish_interface; +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* TWOFISH_H_ */ diff --git a/sys/include/fd.h b/sys/include/fd.h index 4f752d8a4c..8e99e25114 100644 --- a/sys/include/fd.h +++ b/sys/include/fd.h @@ -25,6 +25,10 @@ #include "kernel_types.h" #include "cpu.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * File descriptor table. */ @@ -87,4 +91,8 @@ fd_t *fd_get(int fd); */ void fd_destroy(int fd); +#ifdef __cplusplus +} +#endif + #endif /* FD_H */ diff --git a/sys/include/hash_string.h b/sys/include/hash_string.h index f3494fd9a9..d65dedd8ca 100644 --- a/sys/include/hash_string.h +++ b/sys/include/hash_string.h @@ -9,7 +9,15 @@ #ifndef __HASH_STRING_H #define __HASH_STRING_H +#ifdef __cplusplus +extern "C" { +#endif + unsigned long hash_string(unsigned char *str); int cmp_string(char *a, char *b); +#ifdef __cplusplus +} +#endif + #endif /* __HASH_STRING_H */ diff --git a/sys/include/hashes.h b/sys/include/hashes.h index 080134785d..0019750a15 100644 --- a/sys/include/hashes.h +++ b/sys/include/hashes.h @@ -25,6 +25,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief djb2_hash * @@ -155,5 +159,9 @@ uint32_t rotating_hash(const uint8_t *buf, size_t len); */ uint32_t one_at_a_time_hash(const uint8_t *buf, size_t len); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* __HASHES_H */ diff --git a/sys/include/ping.h b/sys/include/ping.h index 65e4e13c9f..a6ec62319c 100644 --- a/sys/include/ping.h +++ b/sys/include/ping.h @@ -15,6 +15,10 @@ #include "radio/radio.h" +#ifdef __cplusplus +extern "C" { +#endif + void init_payload(void); void ping_init(protocol_t protocol, uint8_t channr, radio_address_t addr); void ping(radio_address_t addr, uint8_t channr); @@ -38,3 +42,7 @@ typedef struct pong { typedef struct ping_payload { char *payload; } ping_payload; + +#ifdef __cplusplus +} +#endif diff --git a/sys/include/pipe.h b/sys/include/pipe.h index 8f53e1eb16..60ee51b87a 100644 --- a/sys/include/pipe.h +++ b/sys/include/pipe.h @@ -38,6 +38,10 @@ #include "ringbuffer.h" #include "thread.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifndef PIPE_BUF # define PIPE_BUF (128) /**< Size of a dynamically malloc'd pipe. */ #endif @@ -108,6 +112,10 @@ pipe_t *pipe_malloc(unsigned size); */ void pipe_free(pipe_t *rp); +#ifdef __cplusplus +} +#endif + #endif /** * @} diff --git a/sys/include/posix_io.h b/sys/include/posix_io.h index d0e65204fb..49dd93bd45 100644 --- a/sys/include/posix_io.h +++ b/sys/include/posix_io.h @@ -22,6 +22,10 @@ #include "kernel_types.h" +#ifdef __cplusplus +extern "C" { +#endif + #define OPEN 0 #define CLOSE 1 #define READ 2 @@ -37,5 +41,9 @@ int posix_close(int pid); int posix_read(int pid, char *buffer, int bufsize); int posix_write(int pid, char *buffer, int bufsize); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* __READ_H */ diff --git a/sys/include/ps.h b/sys/include/ps.h index 312cea805f..a15bbf3b3d 100644 --- a/sys/include/ps.h +++ b/sys/include/ps.h @@ -16,7 +16,15 @@ #ifndef __PS_H #define __PS_H +#ifdef __cplusplus +extern "C" { +#endif + void thread_print_all(void); void _ps_handler(int argc, char **argv); +#ifdef __cplusplus +} +#endif + #endif /* __PS_H */ diff --git a/sys/include/radio/radio.h b/sys/include/radio/radio.h index 847a6dd275..40525ca33c 100644 --- a/sys/include/radio/radio.h +++ b/sys/include/radio/radio.h @@ -37,6 +37,10 @@ #include #include "radio/types.h" +#ifdef __cplusplus +extern "C" { +#endif + #define L1_PROTOCOL_CATCH_ALL (0xff) ///< Catch all protocol ID enum layer_1_protocols { @@ -72,6 +76,10 @@ typedef struct { void (*print_config)(void); } radio_t; +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* RADIO_H_ */ diff --git a/sys/include/radio/types.h b/sys/include/radio/types.h index 9fd48ee7a8..463c92b939 100644 --- a/sys/include/radio/types.h +++ b/sys/include/radio/types.h @@ -30,6 +30,10 @@ #include "board.h" #include "timex.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef uint8_t protocol_t; ///< Packet protocol type typedef uint16_t radio_address_t; ///< Radio layer address type @@ -97,4 +101,8 @@ typedef void (*packet_handler_t)(void *payload, int payload_size, packet_info_t */ typedef void (*packet_monitor_t)(void *payload, int payload_size, protocol_t protocol, packet_info_t *packet_info); +#ifdef __cplusplus +} +#endif + #endif /* COMMONTYPES_H_ */ diff --git a/sys/include/random.h b/sys/include/random.h index d8abcec494..88c4994164 100644 --- a/sys/include/random.h +++ b/sys/include/random.h @@ -15,6 +15,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef PRNG_FLOAT # define PRNG_FLOAT (0) #endif @@ -72,3 +76,7 @@ double genrand_real_exclusive(void); double genrand_res53(void); #endif /* PRNG_FLOAT */ + +#ifdef __cplusplus +} +#endif diff --git a/sys/include/ringbuffer.h b/sys/include/ringbuffer.h index 17b6806955..13856358b2 100644 --- a/sys/include/ringbuffer.h +++ b/sys/include/ringbuffer.h @@ -19,6 +19,10 @@ #ifndef __RINGBUFFER_H #define __RINGBUFFER_H +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Ringbuffer. * @details Non thread-safe FIFO ringbuffer implementation around a `char` array. @@ -146,4 +150,8 @@ int ringbuffer_peek_one(const ringbuffer_t *restrict rb); */ unsigned ringbuffer_peek(const ringbuffer_t *restrict rb, char *buf, unsigned n); +#ifdef __cplusplus +} +#endif + #endif /* __RINGBUFFER_H */ diff --git a/sys/include/shell.h b/sys/include/shell.h index 13df325e38..42a8ab192c 100644 --- a/sys/include/shell.h +++ b/sys/include/shell.h @@ -19,6 +19,10 @@ #include "attributes.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Protype of a shell callback handler. * @details The functions supplied to shell_init() must use this signature. @@ -84,4 +88,8 @@ void shell_init(shell_t *shell, */ void shell_run(shell_t *shell) NORETURN; +#ifdef __cplusplus +} +#endif + #endif /* __SHELL_H */ diff --git a/sys/include/shell_commands.h b/sys/include/shell_commands.h index 8eb68dd7e8..a9100c39db 100644 --- a/sys/include/shell_commands.h +++ b/sys/include/shell_commands.h @@ -11,6 +11,10 @@ #include "shell.h" +#ifdef __cplusplus +extern "C" { +#endif + #define DISK_GET_SECTOR_SIZE "dget_ssize" #define DISK_GET_SECTOR_COUNT "dget_scount" #define DISK_GET_BLOCK_SIZE "dget_bsize" @@ -19,4 +23,8 @@ extern const shell_command_t _shell_command_list[]; +#ifdef __cplusplus +} +#endif + #endif /* __SHELL_COMMANDS_H */ diff --git a/sys/include/timex.h b/sys/include/timex.h index b51cc4b17d..b6e9140549 100644 --- a/sys/include/timex.h +++ b/sys/include/timex.h @@ -25,6 +25,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + // mspgcc bug : PRIxxx macros not defined before mid-2011 versions #ifndef PRIu32 #define PRIu32 "lu" @@ -164,5 +168,9 @@ static inline const char *timex_to_str(timex_t t, char *timestamp) return timestamp; } +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* __TIMEX_H */ diff --git a/sys/include/tm.h b/sys/include/tm.h index 35552c8da7..484eacb53c 100644 --- a/sys/include/tm.h +++ b/sys/include/tm.h @@ -23,6 +23,10 @@ #include "attributes.h" +#ifdef __cplusplus +extern "C" { +#endif + #define TM_WDAY_SUN (0) /**< Sunday in `struct tm::tm_wday`. */ #define TM_WDAY_MON (1) /**< Monday in `struct tm::tm_wday`. */ #define TM_WDAY_TUE (2) /**< Tuesday in `struct tm::tm_wday`. */ @@ -110,4 +114,8 @@ int tm_is_valid_date(int year, int mon, int mday) CONST; */ int tm_is_valid_time(int hour, int min, int sec) CONST; +#ifdef __cplusplus +} +#endif + #endif diff --git a/sys/include/transceiver.h b/sys/include/transceiver.h index 0c67d34fcb..22291c1cd4 100644 --- a/sys/include/transceiver.h +++ b/sys/include/transceiver.h @@ -77,6 +77,10 @@ #endif #endif +#ifdef __cplusplus +extern "C" { +#endif + /* Stack size for transceiver thread */ #ifndef TRANSCEIVER_STACK_SIZE #define TRANSCEIVER_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT) @@ -247,5 +251,9 @@ uint8_t transceiver_register(transceiver_type_t transceivers, kernel_pid_t pid); */ uint8_t transceiver_unregister(transceiver_type_t transceivers, kernel_pid_t pid); +#ifdef __cplusplus +} +#endif + #endif /* TRANSCEIVER_H */ /** @} */ diff --git a/sys/include/vtimer.h b/sys/include/vtimer.h index 4db4fa21d4..b9388498f0 100644 --- a/sys/include/vtimer.h +++ b/sys/include/vtimer.h @@ -28,6 +28,10 @@ #include "timex.h" #include "msg.h" +#ifdef __cplusplus +extern "C" { +#endif + #define MSG_TIMER 12345 /** @@ -138,5 +142,9 @@ void vtimer_print_long_queue(void); #endif +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* __VTIMER_H */ diff --git a/sys/net/ccn_lite/ccnl-core.h b/sys/net/ccn_lite/ccnl-core.h index 4c7e092ffb..644768d258 100644 --- a/sys/net/ccn_lite/ccnl-core.h +++ b/sys/net/ccn_lite/ccnl-core.h @@ -54,6 +54,10 @@ #include "ccnl.h" +#ifdef __cplusplus +extern "C" { +#endif + // ---------------------------------------------------------------------- typedef union { @@ -290,5 +294,9 @@ void free_4ptr_list(void *a, void *b, void *c, void *d); void free_prefix(struct ccnl_prefix_s *p); void free_content(struct ccnl_content_s *c); +#ifdef __cplusplus +} +#endif + #endif /*CCNL_CORE_H__*/ // eof diff --git a/sys/net/ccn_lite/ccnl-ext.h b/sys/net/ccn_lite/ccnl-ext.h index 18fe2bff4a..ea1f0411dc 100644 --- a/sys/net/ccn_lite/ccnl-ext.h +++ b/sys/net/ccn_lite/ccnl-ext.h @@ -26,6 +26,10 @@ #ifndef CCNL_EXT_H__ #define CCNL_EXT_H__ +#ifdef __cplusplus +extern "C" { +#endif + #define compute_ccnx_digest(buf) sha256(buf->data, buf->datalen, NULL) #ifdef USE_FRAG @@ -93,6 +97,10 @@ ccnl_prefix_clone_strip(struct ccnl_prefix_s *p, int strip); char *ccnl_prefix_to_path(struct ccnl_prefix_s *pr); +#ifdef __cplusplus +} +#endif + #endif /* CCNL_EXT_H__ */ // eof diff --git a/sys/net/ccn_lite/ccnl-includes.h b/sys/net/ccn_lite/ccnl-includes.h index d0637421d3..89e5667349 100644 --- a/sys/net/ccn_lite/ccnl-includes.h +++ b/sys/net/ccn_lite/ccnl-includes.h @@ -28,10 +28,18 @@ #include "crypto/sha256.h" +#ifdef __cplusplus +extern "C" { +#endif + #define RIOT_MSG_DEV (1) #define RIOT_TRANS_DEV (2) #define RIOT_MSG_IDX (0) #define RIOT_TRANS_IDX (1) +#ifdef __cplusplus +} +#endif + // eof diff --git a/sys/net/ccn_lite/ccnl-pdu.h b/sys/net/ccn_lite/ccnl-pdu.h index f655feb075..dd36757fd6 100644 --- a/sys/net/ccn_lite/ccnl-pdu.h +++ b/sys/net/ccn_lite/ccnl-pdu.h @@ -16,6 +16,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef __cplusplus +extern "C" { +#endif + int dehead(unsigned char **buf, int *len, int *num, int *typ); int mkHeader(unsigned char *buf, unsigned int num, unsigned int tt); int mkBlob(unsigned char *out, unsigned int num, unsigned int tt, char *cp, int cnt); @@ -26,3 +30,7 @@ int unmkBinaryInt(unsigned char **data, int *datalen, unsigned int *result, unsigned char *width); int mkInterest(char **namecomp, unsigned int *nonce, unsigned char *out); int mkContent(char **namecomp, char *data, int datalen, unsigned char *out); + +#ifdef __cplusplus +} +#endif diff --git a/sys/net/ccn_lite/ccnl-platform.h b/sys/net/ccn_lite/ccnl-platform.h index c074879de3..4a17cbce11 100644 --- a/sys/net/ccn_lite/ccnl-platform.h +++ b/sys/net/ccn_lite/ccnl-platform.h @@ -20,6 +20,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + // (ms) I moved the following struct def here because it is used by all // containers apart from the kernel (this way I don't need to redefine it // for omnet. @@ -47,3 +51,7 @@ void ccnl_rem_timer(void *h); extern struct ccnl_timer_s *eventqueue; + +#ifdef __cplusplus +} +#endif diff --git a/sys/net/ccn_lite/ccnl-riot-compat.h b/sys/net/ccn_lite/ccnl-riot-compat.h index 85076a412b..9b9066e338 100644 --- a/sys/net/ccn_lite/ccnl-riot-compat.h +++ b/sys/net/ccn_lite/ccnl-riot-compat.h @@ -18,6 +18,10 @@ #include "ccn_lite/ccnl-riot.h" +#ifdef __cplusplus +extern "C" { +#endif + #define RIOT_CCN_EVENT_NUMBER_OFFSET (1 << 8) #define RIOT_BROADCAST (UINT16_MAX) @@ -32,3 +36,7 @@ int riot_send_msg(uint8_t *buf, uint16_t size, uint16_t to); void riot_send_nack(uint16_t to); kernel_pid_t riot_start_helper_thread(void); char *riot_ccnl_event_to_string(int event); + +#ifdef __cplusplus +} +#endif diff --git a/sys/net/ccn_lite/ccnl.h b/sys/net/ccn_lite/ccnl.h index 2cf677f6c4..6864633475 100644 --- a/sys/net/ccn_lite/ccnl.h +++ b/sys/net/ccn_lite/ccnl.h @@ -21,6 +21,10 @@ * 2011-03-30 created */ +#ifdef __cplusplus +extern "C" { +#endif + #define CCNL_MAX_INTERFACES 2 /* transceiver and msg interfaces */ #define CCNL_INTEREST_TIMEOUT_SEC 0 @@ -139,4 +143,8 @@ // function alias for RIOTs debug infrastructure #define DEBUGMSG(LVL, ...) DEBUG(__VA_ARGS__) +#ifdef __cplusplus +} +#endif + // eof diff --git a/sys/net/ccn_lite/ccnx.h b/sys/net/ccn_lite/ccnx.h index 4ba66e12e9..40829d7696 100644 --- a/sys/net/ccn_lite/ccnx.h +++ b/sys/net/ccn_lite/ccnx.h @@ -20,6 +20,10 @@ * 2011-03-13 created */ +#ifdef __cplusplus +extern "C" { +#endif + // ---------------------------------------------------------------------- #define CCN_DEFAULT_MTU PAYOAD_SIZE @@ -69,4 +73,8 @@ #define CCN_DTAG_SEQNO 256 #define CCN_DTAG_CCNPDU 17702112 +#ifdef __cplusplus +} +#endif + // eof diff --git a/sys/net/ccn_lite/util/ccn-lite-ctrl.h b/sys/net/ccn_lite/util/ccn-lite-ctrl.h index c85cf79ce7..4e2c47d992 100644 --- a/sys/net/ccn_lite/util/ccn-lite-ctrl.h +++ b/sys/net/ccn_lite/util/ccn-lite-ctrl.h @@ -16,7 +16,15 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef __cplusplus +extern "C" { +#endif + int mkNewFaceRequest(unsigned char *out, char *macsrc, char *ip4src, char *host, char *port, char *flags); int mkPrefixregRequest(unsigned char *out, char reg, char *path, char *faceid); + +#ifdef __cplusplus +} +#endif diff --git a/sys/net/include/ccn_lite/ccnl-riot.h b/sys/net/include/ccn_lite/ccnl-riot.h index e83414de19..ee91ca039c 100644 --- a/sys/net/include/ccn_lite/ccnl-riot.h +++ b/sys/net/include/ccn_lite/ccnl-riot.h @@ -38,6 +38,10 @@ #include "transceiver.h" +#ifdef __cplusplus +extern "C" { +#endif + #define TRANSCEIVER TRANSCEIVER_DEFAULT #define CCNL_DEFAULT_CHANNEL 6 @@ -82,6 +86,10 @@ void *ccnl_riot_relay_start(void *arg); */ void *ccnl_riot_appserver_start(void *arg); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/net/include/ccn_lite/test_data/text.txt.ccnb.h b/sys/net/include/ccn_lite/test_data/text.txt.ccnb.h index f1636a518f..2eedb00dc9 100644 --- a/sys/net/include/ccn_lite/test_data/text.txt.ccnb.h +++ b/sys/net/include/ccn_lite/test_data/text.txt.ccnb.h @@ -16,6 +16,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef __cplusplus +extern "C" { +#endif + #define RIOT_CCNL_POPULATE (1) #if RIOT_CCNL_POPULATE @@ -357,3 +361,7 @@ unsigned char text_txt_ccnb_9[] = { unsigned int text_txt_ccnb_9_len = 118; #endif + +#ifdef __cplusplus +} +#endif diff --git a/sys/net/include/ccn_lite/util/ccnl-riot-client.h b/sys/net/include/ccn_lite/util/ccnl-riot-client.h index a3fcbdbeb3..4ae429d079 100644 --- a/sys/net/include/ccn_lite/util/ccnl-riot-client.h +++ b/sys/net/include/ccn_lite/util/ccnl-riot-client.h @@ -27,6 +27,10 @@ #ifndef CCNL_RIOT_CLIENT_H #define CCNL_RIOT_CLIENT_H +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief high level function to fetch a file (all chunks of a file) * @@ -103,6 +107,10 @@ int ccnl_riot_client_new_face(kernel_pid_t relay_pid, char *type, char *faceid, int ccnl_riot_client_register_prefix(kernel_pid_t relay_pid, char *prefix, char *faceid, unsigned char *reply_buf); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/net/include/etx_beaconing.h b/sys/net/include/etx_beaconing.h index 0fa6b5c9aa..95dec4adca 100644 --- a/sys/net/include/etx_beaconing.h +++ b/sys/net/include/etx_beaconing.h @@ -11,6 +11,10 @@ #include #include "sixlowpan.h" +#ifdef __cplusplus +extern "C" { +#endif + //[option|length|ipaddr.|packetcount] with up to 15 ipaddr|packetcount pairs // 1 Byte 1 Byte 1 Byte 1 Byte #define ETX_BUF_SIZE (32) @@ -99,4 +103,8 @@ void etx_update(etx_neighbor_t *neighbor); #define ETX_PKT_HDR_LEN (2) //Option type + Length (1 Byte each) #define ETX_PKT_DATA (2) //Begin of Data Bytes +#ifdef __cplusplus +} +#endif + #endif /* ETX_BEACONING_H_ */ diff --git a/sys/net/include/ieee802154_frame.h b/sys/net/include/ieee802154_frame.h index cb5e8d4e55..5e38b73715 100644 --- a/sys/net/include/ieee802154_frame.h +++ b/sys/net/include/ieee802154_frame.h @@ -25,6 +25,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* maximum 802.15.4 header length */ #define IEEE_802154_MAX_HDR_LEN (23) /* ...and FCS*/ @@ -109,5 +113,9 @@ uint8_t ieee802154_frame_read(uint8_t *buf, ieee802154_frame_t *frame, uint8_t l void ieee802154_frame_print_fcf_frame(ieee802154_frame_t *frame); uint16_t ieee802154_frame_get_fcs(const uint8_t *frame, uint8_t frame_len); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* IEEE802154_IEEE802154_FRAME */ diff --git a/sys/net/include/inet_ntop.h b/sys/net/include/inet_ntop.h index 5a191c83c0..8f6fa4185c 100644 --- a/sys/net/include/inet_ntop.h +++ b/sys/net/include/inet_ntop.h @@ -19,6 +19,10 @@ #define INET_NTOP_H_ #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef AF_INET #define AF_INET 2 ///< internetwork address family: UDP, TCP, etc. #endif @@ -50,4 +54,8 @@ const char *inet_ntop(int af, const void *src, char *dst, size_t size); +#ifdef __cplusplus +} +#endif + #endif /* INET_NTOP_H_ */ diff --git a/sys/net/include/inet_pton.h b/sys/net/include/inet_pton.h index 52bb90d2a7..a852950e27 100644 --- a/sys/net/include/inet_pton.h +++ b/sys/net/include/inet_pton.h @@ -19,6 +19,10 @@ #define INET_PTON_H_ #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef AF_INET #define AF_INET 2 ///< internetwork address family: UDP, TCP, etc. #endif @@ -54,4 +58,8 @@ int inet_pton(int af, const char *src, void *dst); +#ifdef __cplusplus +} +#endif + #endif /* INET_PTON_H_ */ diff --git a/sys/net/include/ipv6.h b/sys/net/include/ipv6.h index 494ec93cb0..eccc499cb8 100644 --- a/sys/net/include/ipv6.h +++ b/sys/net/include/ipv6.h @@ -28,6 +28,14 @@ #include "../network_layer/sixlowpan/icmp.h" /* TODO: remove if not needed anymore */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + #endif /* IPV6_H */ /** * @} diff --git a/sys/net/include/net_help.h b/sys/net/include/net_help.h index de6291305e..f5d359bf16 100644 --- a/sys/net/include/net_help.h +++ b/sys/net/include/net_help.h @@ -29,6 +29,10 @@ #include "byteorder.h" +#ifdef __cplusplus +extern "C" { +#endif + #define BITSET(var,pos) ((var) & (1<<(pos))) static inline uint16_t HTONS(uint16_t a) @@ -66,5 +70,9 @@ static inline uint64_t NTOHLL(uint64_t a) uint16_t csum(uint16_t sum, uint8_t *buf, uint16_t len); void printArrayRange(uint8_t *array, uint16_t len, char *str); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* __NET_HELP_H */ diff --git a/sys/net/include/net_if.h b/sys/net/include/net_if.h index 9379817c8d..98258bd392 100644 --- a/sys/net/include/net_if.h +++ b/sys/net/include/net_if.h @@ -27,6 +27,10 @@ #include "mutex.h" #include "transceiver.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief type to specify types of upper layer addresses */ @@ -497,6 +501,10 @@ int32_t net_if_get_pan_id(int if_id); */ int32_t net_if_set_pan_id(int if_id, uint16_t pan_id); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/net/include/pktbuf.h b/sys/net/include/pktbuf.h index d1ccb8348c..5529affcf2 100644 --- a/sys/net/include/pktbuf.h +++ b/sys/net/include/pktbuf.h @@ -31,6 +31,10 @@ #include "cpu-conf.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifndef PKTBUF_SIZE /** * @brief Maximum size of the packet buffer. @@ -183,5 +187,9 @@ int pktbuf_contains(const void *pkt); void pktbuf_reset(void); #endif +#ifdef __cplusplus +} +#endif + #endif /* __PKTBUF_H_ */ /** @} */ diff --git a/sys/net/include/pktqueue.h b/sys/net/include/pktqueue.h index 20f35de221..6f00f7332d 100644 --- a/sys/net/include/pktqueue.h +++ b/sys/net/include/pktqueue.h @@ -26,6 +26,10 @@ #include "priority_queue.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief data type for packet queue nodes * @@ -129,6 +133,10 @@ static inline void pktqueue_remove(pktqueue_t *queue, pktqueue_node_t *node) priority_queue_remove((priority_queue_t *)queue, (priority_queue_node_t *) node); } +#ifdef __cplusplus +} +#endif + #endif /* __PKTQUEUE_H_ */ /** * @} diff --git a/sys/net/include/protocol-multiplex.h b/sys/net/include/protocol-multiplex.h index 5c89c2767f..c712947085 100644 --- a/sys/net/include/protocol-multiplex.h +++ b/sys/net/include/protocol-multiplex.h @@ -26,6 +26,10 @@ #include "radio/types.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { packet_handler_t handler; protocol_t protocol; @@ -42,5 +46,9 @@ int pm_set_handler(const pm_table_t *table, protocol_t protocol, packet_handler_ void pm_remove_handler(const pm_table_t *table, protocol_t protocol, packet_handler_t handler); int pm_invoke(const pm_table_t *table, protocol_t protocol, void *payload, int payload_size, packet_info_t *packet_info); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* PROTOCOLMULTIPLEX_H_ */ diff --git a/sys/net/include/rpl.h b/sys/net/include/rpl.h index 2c27dafbc4..5ccd84c410 100644 --- a/sys/net/include/rpl.h +++ b/sys/net/include/rpl.h @@ -35,6 +35,10 @@ #include "ipv6.h" #include "rpl/rpl_dodag.h" +#ifdef __cplusplus +extern "C" { +#endif + #undef CC1100_RADIO_MODE #define CC1100_RADIO_MODE CC1100_MODE_WOR @@ -263,5 +267,9 @@ void rpl_clear_routing_table(void); * */ rpl_routing_entry_t *rpl_get_routing_table(void); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* __RPL_H */ diff --git a/sys/net/include/rpl/rpl_config.h b/sys/net/include/rpl/rpl_config.h index 9e8f7881b7..4d14631002 100644 --- a/sys/net/include/rpl/rpl_config.h +++ b/sys/net/include/rpl/rpl_config.h @@ -18,6 +18,10 @@ #ifndef RPL_CONFIG_H_INCLUDED #define RPL_CONFIG_H_INCLUDED +#ifdef __cplusplus +extern "C" { +#endif + /* Default values */ #define RPL_NO_DOWNWARD_ROUTES 0x00 #define RPL_NON_STORING_MODE 0x01 @@ -133,4 +137,8 @@ static inline bool RPL_COUNTER_GREATER_THAN(uint8_t A,uint8_t B) #define RPL_GROUNDED_SHIFT 7 #define RPL_DEFAULT_OCP 0 +#ifdef __cplusplus +} +#endif + #endif diff --git a/sys/net/include/rpl/rpl_dodag.h b/sys/net/include/rpl/rpl_dodag.h index 465cbf2a1f..80e8b9d79a 100644 --- a/sys/net/include/rpl/rpl_dodag.h +++ b/sys/net/include/rpl/rpl_dodag.h @@ -20,6 +20,10 @@ #include "rpl_structs.h" #include "rpl_config.h" +#ifdef __cplusplus +extern "C" { +#endif + void rpl_instances_init(void); rpl_instance_t *rpl_new_instance(uint8_t instanceid); rpl_instance_t *rpl_get_instance(uint8_t instanceid); @@ -42,3 +46,7 @@ void rpl_parent_update(rpl_parent_t *parent); void rpl_global_repair(rpl_dodag_t *dodag, ipv6_addr_t *p_addr, uint16_t rank); void rpl_local_repair(void); uint16_t rpl_calc_rank(uint16_t abs_rank, uint16_t minhoprankincrease); + +#ifdef __cplusplus +} +#endif diff --git a/sys/net/include/rpl/rpl_storing.h b/sys/net/include/rpl/rpl_storing.h index fa2412a4d4..9a6e85abb2 100644 --- a/sys/net/include/rpl/rpl_storing.h +++ b/sys/net/include/rpl/rpl_storing.h @@ -30,6 +30,10 @@ #include "rpl_config.h" #include "rpl.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Initialization of RPL-root. * @@ -141,5 +145,9 @@ void recv_rpl_dao_ack_mode(void); */ void rpl_send(ipv6_addr_t *destination, uint8_t *payload, uint16_t p_len, uint8_t next_header); +#ifdef __cplusplus +} +#endif + #endif /* __RPL_SM_H */ /** @} */ diff --git a/sys/net/include/rpl/rpl_structs.h b/sys/net/include/rpl/rpl_structs.h index b3731774c4..b82d75980b 100644 --- a/sys/net/include/rpl/rpl_structs.h +++ b/sys/net/include/rpl/rpl_structs.h @@ -20,6 +20,11 @@ #ifndef RPL_STRUCTS_H_INCLUDED #define RPL_STRUCTS_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + /* Modes of Operation */ /* DIO Base Object (RFC 6550 Fig. 14) */ @@ -179,4 +184,8 @@ typedef struct { uint8_t used; } rpl_routing_entry_t; +#ifdef __cplusplus +} +#endif + #endif diff --git a/sys/net/include/sixlowpan.h b/sys/net/include/sixlowpan.h index cfeaad5d27..b2f0e6125e 100644 --- a/sys/net/include/sixlowpan.h +++ b/sys/net/include/sixlowpan.h @@ -47,5 +47,13 @@ #include "sixlowpan/lowpan.h" #include "sixlowpan/mac.h" +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + #endif /* SIXLOWPAN_H */ /** @} */ diff --git a/sys/net/include/sixlowpan/error.h b/sys/net/include/sixlowpan/error.h index 579d41d420..607ccd4e21 100644 --- a/sys/net/include/sixlowpan/error.h +++ b/sys/net/include/sixlowpan/error.h @@ -19,6 +19,10 @@ #ifndef SIXLOWPAN_ERROR_H #define SIXLOWPAN_ERROR_H +#ifdef __cplusplus +extern "C" { +#endif + /** * Functions return this if call was success. Only defined if not * already defined by other header. @@ -95,5 +99,9 @@ */ #define SIXLOWERROR_CSUM (141) +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* SIXLOWPAN_ERROR_H */ diff --git a/sys/net/include/sixlowpan/icmp.h b/sys/net/include/sixlowpan/icmp.h index e5e8238319..0692ec8997 100644 --- a/sys/net/include/sixlowpan/icmp.h +++ b/sys/net/include/sixlowpan/icmp.h @@ -30,6 +30,10 @@ #include "sixlowpan/types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief ICMPv6 packet type for parameter problem message. * @see @@ -246,5 +250,10 @@ void icmpv6_send_neighbor_adv(ipv6_addr_t *src, ipv6_addr_t *dst, * @return The internet checksum of the given ICMPv6 packet. */ uint16_t icmpv6_csum(ipv6_hdr_t *ipv6_buf, icmpv6_hdr_t *icmpv6_buf); + +#ifdef __cplusplus +} +#endif + #endif /* SIXLOWPAN_ICMP_H */ /** @} */ diff --git a/sys/net/include/sixlowpan/ip.h b/sys/net/include/sixlowpan/ip.h index 89da8d40e9..aab1a7a17f 100644 --- a/sys/net/include/sixlowpan/ip.h +++ b/sys/net/include/sixlowpan/ip.h @@ -31,6 +31,10 @@ #include "net_help.h" #include "sixlowpan/types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief IPv6 maximum transmission unit. */ @@ -542,5 +546,9 @@ void ipv6_iface_set_routing_provider(ipv6_addr_t *(*next_hop)(ipv6_addr_t *dest) */ uint16_t ipv6_csum(ipv6_hdr_t *ipv6_header, uint8_t *buf, uint16_t len, uint8_t proto); +#ifdef __cplusplus +} +#endif + #endif /* SIXLOWPAN_IP_H */ /** @} */ diff --git a/sys/net/include/sixlowpan/lowpan.h b/sys/net/include/sixlowpan/lowpan.h index 2aec806e78..02c5f72689 100644 --- a/sys/net/include/sixlowpan/lowpan.h +++ b/sys/net/include/sixlowpan/lowpan.h @@ -31,6 +31,10 @@ #include "net_if.h" #include "sixlowpan/types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief 6LoWPAN dispatch value for uncompressed IPv6 packets. * @see @@ -301,5 +305,9 @@ void sixlowpan_lowpan_print_reassembly_buffers(void); */ int sixlowpan_lowpan_init(void); +#ifdef __cplusplus +} +#endif + #endif /* SIXLOWPAN_LOWPAN_H */ /** @} */ diff --git a/sys/net/include/sixlowpan/mac.h b/sys/net/include/sixlowpan/mac.h index bd742d0adb..c8f69c0516 100644 --- a/sys/net/include/sixlowpan/mac.h +++ b/sys/net/include/sixlowpan/mac.h @@ -28,6 +28,10 @@ #include "sixlowpan/types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Maximum length of a IEEE 802.15.4 long address represented as string. */ @@ -58,5 +62,9 @@ int sixlowpan_mac_send_ieee802154_frame(int if_id, const void *dest, */ kernel_pid_t sixlowpan_mac_init(void); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* SIXLOWPAN_MAC_H */ diff --git a/sys/net/include/sixlowpan/ndp.h b/sys/net/include/sixlowpan/ndp.h index 5c4a282337..1c7e480eec 100644 --- a/sys/net/include/sixlowpan/ndp.h +++ b/sys/net/include/sixlowpan/ndp.h @@ -30,6 +30,10 @@ #include "timex.h" #include "sixlowpan/types.h" +#ifdef __cplusplus +extern "C" { +#endif + #define NDP_6LOWPAN_CONTEXT_MAX (16) #define NDP_OPT_SLLAO_TYPE (1) @@ -227,5 +231,9 @@ ndp_prefix_info_t *ndp_prefix_info_match(int if_id, const ipv6_addr_t *prefix, ndp_a6br_cache_t *ndp_a6br_cache_get_most_current(void); ndp_a6br_cache_t *ndp_a6br_cache_get_oldest(void); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* SIXLOWPAN_NDP_H */ diff --git a/sys/net/include/sixlowpan/types.h b/sys/net/include/sixlowpan/types.h index 2eced445a0..45d63d49d7 100644 --- a/sys/net/include/sixlowpan/types.h +++ b/sys/net/include/sixlowpan/types.h @@ -26,6 +26,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Data type to represent an EUI-64. */ @@ -394,5 +398,9 @@ typedef enum __attribute__((packed)) { NDP_ADDR_STATE_ANY ///< addresses of this state are always permitted. } ndp_addr_state_t; +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* SIXLOWPAN_TYPES_H */ diff --git a/sys/net/include/socket_base.h b/sys/net/include/socket_base.h index 6ca0d5ef7c..2e335f9511 100644 --- a/sys/net/include/socket_base.h +++ b/sys/net/include/socket_base.h @@ -37,4 +37,12 @@ #include "socket_base/socket.h" #include "socket_base/types.h" +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + #endif /* SOCKET_BASE_H */ diff --git a/sys/net/include/socket_base/in.h b/sys/net/include/socket_base/in.h index a819a5ab76..64b3603023 100644 --- a/sys/net/include/socket_base/in.h +++ b/sys/net/include/socket_base/in.h @@ -29,6 +29,10 @@ #ifndef SOCKET_BASE_IN_H #define SOCKET_BASE_IN_H +#ifdef __cplusplus +extern "C" { +#endif + /* * Protocols (RFC 1700) TODO: may be deleted due to some double definition * in sys/net/sixlowpan/include/sixlowpan/ip.h @@ -149,4 +153,8 @@ #define IN_LOOPBACKNET (127) ///< official! +#ifdef __cplusplus +} +#endif + #endif /* SOCKET_BASE_IN_H */ diff --git a/sys/net/include/socket_base/socket.h b/sys/net/include/socket_base/socket.h index f67df8cf3c..850a977123 100644 --- a/sys/net/include/socket_base/socket.h +++ b/sys/net/include/socket_base/socket.h @@ -28,6 +28,10 @@ #include "socket_base/in.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef uint8_t sa_family_t; ///< POSIX compatible type for address family. typedef uint32_t socklen_t; ///< POSIX compatible type for address length. @@ -327,6 +331,10 @@ int socket_base_accept(int s, sockaddr6_t *addr, socklen_t *addrlen); */ void socket_base_print_sockets(void); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/net/include/socket_base/types.h b/sys/net/include/socket_base/types.h index 6c45603aa1..4ecd9e1c85 100644 --- a/sys/net/include/socket_base/types.h +++ b/sys/net/include/socket_base/types.h @@ -18,6 +18,10 @@ #define SOCKET_BASE_TYPES_H_ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * UDP packet header length */ @@ -69,6 +73,10 @@ typedef struct __attribute__((packed)) { uint16_t urg_pointer; ///< urgent pointer } tcp_hdr_t; +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/net/include/tcp.h b/sys/net/include/tcp.h index 6f9f9f7650..12ce62a2f8 100644 --- a/sys/net/include/tcp.h +++ b/sys/net/include/tcp.h @@ -30,6 +30,10 @@ #include "socket_base/socket.h" #include "socket_base/types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * Initializes tcp. * @@ -37,4 +41,8 @@ */ int tcp_init_transport_layer(void); +#ifdef __cplusplus +} +#endif + #endif /* TCP_H */ diff --git a/sys/net/include/udp.h b/sys/net/include/udp.h index 7268394050..e9d867d522 100644 --- a/sys/net/include/udp.h +++ b/sys/net/include/udp.h @@ -30,6 +30,10 @@ #include "socket_base/socket.h" #include "socket_base/types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * Initializes udp. * @@ -37,4 +41,8 @@ */ int udp_init_transport_layer(void); +#ifdef __cplusplus +} +#endif + #endif /* UDP_H */ diff --git a/sys/net/network_layer/sixlowpan/border/border.h b/sys/net/network_layer/sixlowpan/border/border.h index 2d003b8f4f..78bc598d72 100644 --- a/sys/net/network_layer/sixlowpan/border/border.h +++ b/sys/net/network_layer/sixlowpan/border/border.h @@ -29,6 +29,10 @@ #include "ip.h" #include "semaphore.h" +#ifdef __cplusplus +extern "C" { +#endif + extern ipv6_addr_t *abr_addr; kernel_pid_t border_get_serial_reader(void); @@ -38,4 +42,8 @@ uint8_t *get_serial_in_buffer(int offset); void border_process_lowpan(void); +#ifdef __cplusplus +} +#endif + #endif /* _SIXLOWPAN_BORDER_H*/ diff --git a/sys/net/network_layer/sixlowpan/border/bordermultiplex.h b/sys/net/network_layer/sixlowpan/border/bordermultiplex.h index 6bbb852a3f..db451d14be 100644 --- a/sys/net/network_layer/sixlowpan/border/bordermultiplex.h +++ b/sys/net/network_layer/sixlowpan/border/bordermultiplex.h @@ -24,6 +24,10 @@ #include "ip.h" +#ifdef __cplusplus +extern "C" { +#endif + /* packet types of uart-packets */ #define BORDER_PACKET_RAW_TYPE (0) #define BORDER_PACKET_CONF_TYPE (2) @@ -89,4 +93,8 @@ void multiplex_send_addr_over_uart(ipv6_addr_t *addr); int readpacket(uint8_t *packet_buf, size_t size); int writepacket(uint8_t *packet_buf, size_t size); +#ifdef __cplusplus +} +#endif + #endif /* _SIXLOWPAN_BORDERMULTIPLEX_H*/ diff --git a/sys/net/network_layer/sixlowpan/border/flowcontrol.h b/sys/net/network_layer/sixlowpan/border/flowcontrol.h index 342c88e5f9..c6e21facb2 100644 --- a/sys/net/network_layer/sixlowpan/border/flowcontrol.h +++ b/sys/net/network_layer/sixlowpan/border/flowcontrol.h @@ -28,6 +28,10 @@ #include "border.h" #include "bordermultiplex.h" +#ifdef __cplusplus +extern "C" { +#endif + /* packet types for flowcontrol */ #define BORDER_PACKET_ACK_TYPE (1) @@ -74,4 +78,8 @@ ipv6_addr_t flowcontrol_init(void); void flowcontrol_send_over_uart(border_packet_t *packet, int len); void flowcontrol_deliver_from_uart(border_packet_t *packet, int len); +#ifdef __cplusplus +} +#endif + #endif /* _SIXLOWPAN_FLOWCONTROL_H*/ diff --git a/sys/net/network_layer/sixlowpan/icmp.h b/sys/net/network_layer/sixlowpan/icmp.h index d88f8324d5..d44768fcce 100644 --- a/sys/net/network_layer/sixlowpan/icmp.h +++ b/sys/net/network_layer/sixlowpan/icmp.h @@ -32,6 +32,10 @@ #include "lowpan.h" #include "ip.h" +#ifdef __cplusplus +extern "C" { +#endif + enum option_types_t { OPT_SLLAO = 1, OPT_TLLAO, @@ -58,4 +62,9 @@ void nbr_cache_auto_rem(void); ndp_a6br_cache_t *abr_add_context(uint16_t version, ipv6_addr_t *abr_addr, uint8_t cid); void abr_remove_context(uint8_t cid); + +#ifdef __cplusplus +} +#endif + #endif /* _SIXLOWPAN_ICMP_H*/ diff --git a/sys/net/network_layer/sixlowpan/ip.h b/sys/net/network_layer/sixlowpan/ip.h index 9017673447..9d6a03ef39 100644 --- a/sys/net/network_layer/sixlowpan/ip.h +++ b/sys/net/network_layer/sixlowpan/ip.h @@ -33,6 +33,10 @@ #include "sixlowpan/ip.h" #include "sixlowpan/types.h" +#ifdef __cplusplus +extern "C" { +#endif + /* IPv6 field values */ #define IPV6_VER (0x60) /* size of global buffer */ @@ -99,4 +103,8 @@ ipv6_net_if_hit_t *ipv6_net_if_addr_match(ipv6_net_if_hit_t *hit, const ipv6_add uint32_t get_remaining_time(timex_t *t); void set_remaining_time(timex_t *t, uint32_t time); +#ifdef __cplusplus +} +#endif + #endif /* _SIXLOWPAN_IP_H*/ diff --git a/sys/net/network_layer/sixlowpan/lowpan.h b/sys/net/network_layer/sixlowpan/lowpan.h index 18d13932f4..c9ce70d124 100644 --- a/sys/net/network_layer/sixlowpan/lowpan.h +++ b/sys/net/network_layer/sixlowpan/lowpan.h @@ -25,6 +25,10 @@ #include "sixlowpan/lowpan.h" +#ifdef __cplusplus +extern "C" { +#endif + #define IEEE802154_TRANSCEIVER (TRANSCEIVER_AT86RF231 | TRANSCEIVER_CC2420 | TRANSCEIVER_MC1322X) typedef struct { @@ -48,4 +52,8 @@ lowpan_context_t *lowpan_context_update(uint8_t num, lowpan_context_t *lowpan_context_get(void); lowpan_context_t *lowpan_context_num_lookup(uint8_t num); +#ifdef __cplusplus +} +#endif + #endif /* _SIXLOWPAN_LOWPAN_H */ diff --git a/sys/net/network_layer/sixlowpan/serialnumber.h b/sys/net/network_layer/sixlowpan/serialnumber.h index 4457a54395..6a0c23745b 100644 --- a/sys/net/network_layer/sixlowpan/serialnumber.h +++ b/sys/net/network_layer/sixlowpan/serialnumber.h @@ -14,6 +14,10 @@ #define _SIXLOWPAN_SERIALNUMBER_H #include +#ifdef __cplusplus +extern "C" { +#endif + typedef enum serial_comp_res_t { LESS = 0, EQUAL = 1, @@ -87,4 +91,8 @@ serial_comp_res_t serial_comp16(uint16_t s1, uint16_t s2); **/ serial_comp_res_t serial_comp32(uint32_t s1, uint32_t s2); +#ifdef __cplusplus +} +#endif + #endif /* _SIXLOWPAN_SERIALNUMBER_H*/ diff --git a/sys/net/routing/rpl/of0.h b/sys/net/routing/rpl/of0.h index 9f8f9960a5..90a05e99eb 100644 --- a/sys/net/routing/rpl/of0.h +++ b/sys/net/routing/rpl/of0.h @@ -12,6 +12,14 @@ #include "rpl/rpl_structs.h" #include "rpl/rpl_config.h" +#ifdef __cplusplus +extern "C" { +#endif + rpl_of_t *rpl_get_of0(void); +#ifdef __cplusplus +} +#endif + #endif /* OF0_H */ diff --git a/sys/net/routing/rpl/of_mrhof.h b/sys/net/routing/rpl/of_mrhof.h index a7e20cf54e..51bef40021 100644 --- a/sys/net/routing/rpl/of_mrhof.h +++ b/sys/net/routing/rpl/of_mrhof.h @@ -12,6 +12,10 @@ #include "rpl/rpl_structs.h" #include "rpl/rpl_config.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * Disallow links with greater than 4 expected * transmission counts on the selected path. @@ -46,4 +50,8 @@ rpl_of_t *rpl_get_of_mrhof(void); +#ifdef __cplusplus +} +#endif + #endif /* OF_MRHOF_H */ diff --git a/sys/net/routing/rpl/trickle.h b/sys/net/routing/rpl/trickle.h index 22ade98514..a8a6340402 100644 --- a/sys/net/routing/rpl/trickle.h +++ b/sys/net/routing/rpl/trickle.h @@ -18,6 +18,10 @@ #include "vtimer.h" #include "thread.h" +#ifdef __cplusplus +extern "C" { +#endif + #define TRICKLE_TIMER_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN) #define TRICKLE_INTERVAL_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN) #define DAO_DELAY_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN) @@ -29,3 +33,7 @@ void start_trickle(uint8_t DIOINtMin, uint8_t DIOIntDoubl, uint8_t DIORedundancy void trickle_increment_counter(void); void delay_dao(void); void dao_ack_received(void); + +#ifdef __cplusplus +} +#endif diff --git a/sys/net/transport_layer/socket_base/msg_help.h b/sys/net/transport_layer/socket_base/msg_help.h index 7b9c27cc68..e763855e76 100644 --- a/sys/net/transport_layer/socket_base/msg_help.h +++ b/sys/net/transport_layer/socket_base/msg_help.h @@ -16,6 +16,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + // Function IDs #define FID_SIXLOWIP_TCP 0 #define FID_SIXLOWIP_UDP 1 @@ -40,6 +44,10 @@ int socket_base_net_msg_reply(msg_t *m, msg_t *reply, uint16_t message); int socket_base_net_msg_send(msg_t *m, kernel_pid_t pid, bool block, uint16_t message); int socket_base_net_msg_send_recv(msg_t *m, msg_t *reply, kernel_pid_t pid, uint16_t message); +#ifdef __cplusplus +} +#endif + #endif /* MSG_HELP_H_ */ /** * @} diff --git a/sys/net/transport_layer/socket_base/socket.h b/sys/net/transport_layer/socket_base/socket.h index 0887069925..d00cf85e2d 100644 --- a/sys/net/transport_layer/socket_base/socket.h +++ b/sys/net/transport_layer/socket_base/socket.h @@ -90,10 +90,18 @@ typedef struct { extern socket_internal_t socket_base_sockets[MAX_SOCKETS]; +#ifdef __cplusplus +extern "C" { +#endif + socket_internal_t *socket_base_get_socket(int s); uint16_t socket_base_get_free_source_port(uint8_t protocol); int socket_base_exists_socket(int socket); int socket_base_socket(int domain, int type, int protocol); void socket_base_print_sockets(void); +#ifdef __cplusplus +} +#endif + #endif /* _SOCKET_BASE_SOCKET */ diff --git a/sys/net/transport_layer/tcp/tcp.h b/sys/net/transport_layer/tcp/tcp.h index 9138d750a0..6b72cba99e 100644 --- a/sys/net/transport_layer/tcp/tcp.h +++ b/sys/net/transport_layer/tcp/tcp.h @@ -21,6 +21,10 @@ #include "socket_base/types.h" #include "socket.h" +#ifdef __cplusplus +extern "C" { +#endif + #define TCP_EOO_OPTION (0x00) /* End of option list */ #define TCP_NOP_OPTION (0x01) /* No operation */ #define TCP_MSS_OPTION (0x02) /* Maximum segment size */ @@ -108,6 +112,10 @@ int32_t tcp_recv(int s, void *buf, uint32_t len, int flags); bool tcp_socket_compliancy(int s); int tcp_teardown(socket_internal_t *current_socket); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/net/transport_layer/tcp/tcp_hc.h b/sys/net/transport_layer/tcp/tcp_hc.h index 685874426d..4052c333f8 100644 --- a/sys/net/transport_layer/tcp/tcp_hc.h +++ b/sys/net/transport_layer/tcp/tcp_hc.h @@ -20,6 +20,10 @@ #include "tcp.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifdef TCP_HC #define FULL_HEADER 1 @@ -30,6 +34,11 @@ void update_tcp_hc_context(bool incoming, socket_internal_t *current_socket, tcp uint16_t compress_tcp_packet(socket_internal_t *current_socket, uint8_t *current_tcp_packet, ipv6_hdr_t *temp_ipv6_header, uint8_t flags, uint8_t payload_length); socket_internal_t *decompress_tcp_packet(ipv6_hdr_t *temp_ipv6_header); #endif + +#ifdef __cplusplus +} +#endif + #endif /* TCP_HC_H_ */ /** * @} diff --git a/sys/net/transport_layer/tcp/tcp_timer.h b/sys/net/transport_layer/tcp/tcp_timer.h index 3d488c8b8c..94709f92be 100644 --- a/sys/net/transport_layer/tcp/tcp_timer.h +++ b/sys/net/transport_layer/tcp/tcp_timer.h @@ -15,6 +15,10 @@ #ifndef TCP_TIMER_H_ #define TCP_TIMER_H_ +#ifdef __cplusplus +extern "C" { +#endif + #define TCP_TIMER_RESOLUTION 500*1000 #define SECOND 1000.0f*1000.0f @@ -35,6 +39,10 @@ void *tcp_general_timer(void *); +#ifdef __cplusplus +} +#endif + #endif /* TCP_TIMER_H_ */ /** * @} diff --git a/sys/net/transport_layer/udp/udp.h b/sys/net/transport_layer/udp/udp.h index 5c66b850c7..561bc35c08 100644 --- a/sys/net/transport_layer/udp/udp.h +++ b/sys/net/transport_layer/udp/udp.h @@ -21,6 +21,10 @@ #include "ipv6.h" #include "socket_base/types.h" +#ifdef __cplusplus +extern "C" { +#endif + #define UDP_STACK_SIZE KERNEL_CONF_STACKSIZE_MAIN #define UDP_PKT_RECV_BUF_SIZE (64) @@ -31,6 +35,10 @@ bool udp_socket_compliancy(int s); int32_t udp_recvfrom(int s, void *buf, uint32_t len, int flags, sockaddr6_t *from, uint32_t *fromlen); int32_t udp_sendto(int s, const void *buf, uint32_t len, int flags, sockaddr6_t *to, socklen_t tolen); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/oneway-malloc/include/malloc.h b/sys/oneway-malloc/include/malloc.h index afd730ec81..aa41284dd0 100644 --- a/sys/oneway-malloc/include/malloc.h +++ b/sys/oneway-malloc/include/malloc.h @@ -28,6 +28,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Allocation a block of memory. * @param[in] size Size of the block to allocate in bytes. @@ -65,6 +69,10 @@ void *calloc(int size, size_t cnt); */ void free(void *ptr); +#ifdef __cplusplus +} +#endif + #endif /* __MALLOC_H */ /** diff --git a/sys/posix/include/semaphore.h b/sys/posix/include/semaphore.h index 60e3597506..e3b8e47f16 100644 --- a/sys/posix/include/semaphore.h +++ b/sys/posix/include/semaphore.h @@ -3,11 +3,15 @@ #include +#include "priority_queue.h" + +#ifdef __cplusplus +extern "C" { +#endif + /** Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) -#include "priority_queue.h" - typedef struct sem { volatile unsigned int value; priority_queue_t queue; @@ -98,4 +102,8 @@ int sem_post(sem_t *sem); */ int sem_getvalue(sem_t *sem, int *sval); +#ifdef __cplusplus +} +#endif + #endif /* semaphore.h */ diff --git a/sys/posix/include/strings.h b/sys/posix/include/strings.h index 6e2dd1739a..b2c2013f07 100644 --- a/sys/posix/include/strings.h +++ b/sys/posix/include/strings.h @@ -25,6 +25,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Returns the position of the first (least significant) bit set in * integer *i*, or 0 if no bits are set in i. @@ -115,4 +119,8 @@ int strncasecmp(const char *s1, const char *s2, size_t n); */ #define strcasecmp_l(s1, s2, l) strncasecmp(s1, s2, -1) +#ifdef __cplusplus +} +#endif + #endif /* STRINGS_H */ diff --git a/sys/posix/include/unistd.h b/sys/posix/include/unistd.h index 85f8d663b1..eb927120db 100644 --- a/sys/posix/include/unistd.h +++ b/sys/posix/include/unistd.h @@ -28,6 +28,10 @@ #include "timex.h" #include "vtimer.h" +#ifdef __cplusplus +extern "C" { +#endif + #define STDIN_FILENO 0 ///< stdin file descriptor #define STDOUT_FILENO 1 ///< stdout file descriptor #define STDERR_FILENO 2 ///< stderr file descriptor @@ -100,6 +104,10 @@ int usleep(useconds_t useconds); */ unsigned int sleep(unsigned int seconds); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/posix/pnet/include/arpa/inet.h b/sys/posix/pnet/include/arpa/inet.h index 403047e7fc..8363f6c7bf 100644 --- a/sys/posix/pnet/include/arpa/inet.h +++ b/sys/posix/pnet/include/arpa/inet.h @@ -29,6 +29,10 @@ #include "inet_ntop.h" #include "inet_pton.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef uint16_t in_port_t; ///< Internet port type typedef uint32_t in_addr_t; ///< IPv4 address type @@ -94,6 +98,10 @@ struct in_addr { */ #define ntohs(netshort) NTOHS(netshort) +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/posix/pnet/include/netinet/in.h b/sys/posix/pnet/include/netinet/in.h index 586444e53d..69d552e34b 100644 --- a/sys/posix/pnet/include/netinet/in.h +++ b/sys/posix/pnet/include/netinet/in.h @@ -29,6 +29,10 @@ #include "ipv6.h" #include "socket_base/socket.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * IPv4 socket address type. */ @@ -151,6 +155,10 @@ extern const struct sockaddr_in6 in6addr_loopback; */ #define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff) +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/posix/pnet/include/sys/socket.h b/sys/posix/pnet/include/sys/socket.h index 6edc36a78a..c61365192a 100644 --- a/sys/posix/pnet/include/sys/socket.h +++ b/sys/posix/pnet/include/sys/socket.h @@ -38,6 +38,10 @@ #include "socket_base/socket.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Used to define the socket address. */ @@ -464,6 +468,10 @@ int setsockopt(int socket, int level, int option_name, const void *option_value, */ int socket(int domain, int type, int protocol); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/sys/posix/pthread/include/pthread.h b/sys/posix/pthread/include/pthread.h index b440ead6b0..2366f9b8e3 100644 --- a/sys/posix/pthread/include/pthread.h +++ b/sys/posix/pthread/include/pthread.h @@ -32,6 +32,14 @@ #include "pthread_cancellation.h" #include "pthread_cond.h" +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_barrier.h b/sys/posix/pthread/include/pthread_barrier.h index 5bbb082c4a..9787560068 100644 --- a/sys/posix/pthread/include/pthread_barrier.h +++ b/sys/posix/pthread/include/pthread_barrier.h @@ -11,6 +11,10 @@ #include "mutex.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @def PTHREAD_PROCESS_SHARED * @brief Share the structure with child processes (default). @@ -120,6 +124,10 @@ int pthread_barrierattr_getpshared(const pthread_barrierattr_t *attr, int *pshar */ int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr, int pshared); +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_cancellation.h b/sys/posix/pthread/include/pthread_cancellation.h index c85a91c564..99e33c4492 100644 --- a/sys/posix/pthread/include/pthread_cancellation.h +++ b/sys/posix/pthread/include/pthread_cancellation.h @@ -10,6 +10,10 @@ #ifndef __SYS__POSIX__PTHREAD_CANCELLCATION__H #define __SYS__POSIX__PTHREAD_CANCELLCATION__H +#ifdef __cplusplus +extern "C" { +#endif + #define PTHREAD_CANCEL_DISABLE 0 #define PTHREAD_CANCEL_ENABLE 1 @@ -50,6 +54,10 @@ int pthread_cancel(pthread_t th); */ void pthread_testcancel(void); +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_cleanup.h b/sys/posix/pthread/include/pthread_cleanup.h index 166ebd7550..8d9a843203 100644 --- a/sys/posix/pthread/include/pthread_cleanup.h +++ b/sys/posix/pthread/include/pthread_cleanup.h @@ -9,6 +9,10 @@ #ifndef __SYS__POSIX__PTHREAD_CLEANUP__H #define __SYS__POSIX__PTHREAD_CLEANUP__H +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Internal structure for pthread_cleanup_push() */ @@ -79,6 +83,10 @@ void __pthread_cleanup_pop(__pthread_cleanup_datum_t *datum, int execute); __pthread_cleanup_pop(&____datum__, ____execute__); \ } while (0) +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_cond.h b/sys/posix/pthread/include/pthread_cond.h index dd98ebceac..a990860d03 100644 --- a/sys/posix/pthread/include/pthread_cond.h +++ b/sys/posix/pthread/include/pthread_cond.h @@ -24,6 +24,10 @@ # include "msp430_types.h" #endif +#ifdef __cplusplus +extern "C" { +#endif + /** * @note condition attributes are currently NOT USED in RIOT condition variables */ @@ -132,5 +136,9 @@ int pthread_cond_signal(struct pthread_cond_t *cond); */ int pthread_cond_broadcast(struct pthread_cond_t *cond); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* _CONDITION_VARIABLE_H */ diff --git a/sys/posix/pthread/include/pthread_mutex.h b/sys/posix/pthread/include/pthread_mutex.h index 4b982d48cf..f50e17fc2a 100644 --- a/sys/posix/pthread/include/pthread_mutex.h +++ b/sys/posix/pthread/include/pthread_mutex.h @@ -14,6 +14,10 @@ #include "kernel.h" #include "mutex.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Pthread mutexes are quite the same as RIOT mutexes. * @details Recursive locking is not supported. @@ -97,6 +101,10 @@ int pthread_mutex_getprioceiling(const pthread_mutex_t *mutex, int *prioceiling) */ int pthread_mutex_setprioceiling(pthread_mutex_t *mutex, int prioceiling, int *old_ceiling); +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_mutex_attr.h b/sys/posix/pthread/include/pthread_mutex_attr.h index 4bdd03b3ad..632164e0aa 100644 --- a/sys/posix/pthread/include/pthread_mutex_attr.h +++ b/sys/posix/pthread/include/pthread_mutex_attr.h @@ -11,6 +11,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @def PTHREAD_MUTEX_NORMAL * @brief A non-error correcting mutex (default). @@ -199,6 +203,10 @@ int pthread_mutexattr_getrobust(const pthread_mutexattr_t *attr, int *robustness */ int pthread_mutexattr_setrobust(pthread_mutexattr_t *attr, int robustness); +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_once.h b/sys/posix/pthread/include/pthread_once.h index e5e399f2a8..397a49b5c3 100644 --- a/sys/posix/pthread/include/pthread_once.h +++ b/sys/posix/pthread/include/pthread_once.h @@ -9,6 +9,10 @@ #ifndef __SYS__POSIX__PTHREAD_ONCE__H #define __SYS__POSIX__PTHREAD_ONCE__H +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Datatype to supply to pthread_once(). */ @@ -32,6 +36,10 @@ typedef volatile int pthread_once_t; */ int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)); +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_rwlock.h b/sys/posix/pthread/include/pthread_rwlock.h index 0cb07e12ef..09bdb469f9 100644 --- a/sys/posix/pthread/include/pthread_rwlock.h +++ b/sys/posix/pthread/include/pthread_rwlock.h @@ -15,6 +15,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief A fair reader writer lock. * @details The implementation ensures that readers and writers of the same priority @@ -161,6 +165,10 @@ bool __pthread_rwlock_blocked_readingly(const pthread_rwlock_t *rwlock); */ bool __pthread_rwlock_blocked_writingly(const pthread_rwlock_t *rwlock); +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_rwlock_attr.h b/sys/posix/pthread/include/pthread_rwlock_attr.h index 05c1d9ce44..1c4a789b91 100644 --- a/sys/posix/pthread/include/pthread_rwlock_attr.h +++ b/sys/posix/pthread/include/pthread_rwlock_attr.h @@ -11,6 +11,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Attributes for a new reader/writer lock. * @details The options set in this struct will be ignored by pthread_rwlock_init(). @@ -64,6 +68,10 @@ int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *attr, int *pshared */ int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr, int pshared); +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_scheduling.h b/sys/posix/pthread/include/pthread_scheduling.h index a0694f5bc5..967c9b69c5 100644 --- a/sys/posix/pthread/include/pthread_scheduling.h +++ b/sys/posix/pthread/include/pthread_scheduling.h @@ -10,6 +10,10 @@ #ifndef __SYS__POSIX__PTHREAD_SCHEDULING__H #define __SYS__POSIX__PTHREAD_SCHEDULING__H +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Unimplemented. * @note Due to the native of RIOT it is unlikely that this function will ever be implemented. @@ -39,6 +43,10 @@ int pthread_getschedparam(pthread_t target_thread, int *policy, struct sched_par */ int pthread_setschedprio(pthread_t target_thread, int prio); +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_spin.h b/sys/posix/pthread/include/pthread_spin.h index 9d6b30eac3..8ad6a254e7 100644 --- a/sys/posix/pthread/include/pthread_spin.h +++ b/sys/posix/pthread/include/pthread_spin.h @@ -14,6 +14,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief A spinlock. * @warning Spinlocks should be avoided. @@ -73,6 +77,10 @@ int pthread_spin_trylock(pthread_spinlock_t *lock); */ int pthread_spin_unlock(pthread_spinlock_t *lock); +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_threading.h b/sys/posix/pthread/include/pthread_threading.h index 1d8d57928c..c1367f930f 100644 --- a/sys/posix/pthread/include/pthread_threading.h +++ b/sys/posix/pthread/include/pthread_threading.h @@ -11,6 +11,10 @@ #include "attributes.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Datatype to identify a POSIX thread. * @note The pthread ids are one off to the index in the internal array. @@ -91,6 +95,10 @@ static inline int pthread_equal(pthread_t thread1, pthread_t thread2) return thread1 == thread2; } +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/posix/pthread/include/pthread_threading_attr.h b/sys/posix/pthread/include/pthread_threading_attr.h index 82dbe3b796..39f17ddb2b 100644 --- a/sys/posix/pthread/include/pthread_threading_attr.h +++ b/sys/posix/pthread/include/pthread_threading_attr.h @@ -9,6 +9,10 @@ #ifndef __SYS__POSIX__PTHREAD_THREADING_ATTR__H #define __SYS__POSIX__PTHREAD_THREADING_ATTR__H +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief An attribute set to supply to pthread_create() * @details A zeroed out datum is default initiliazed. @@ -189,6 +193,10 @@ int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize); */ int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize); +#ifdef __cplusplus +} +#endif + #endif /** diff --git a/sys/quad_math/quad.h b/sys/quad_math/quad.h index 2060b0d622..ab37d13e4b 100644 --- a/sys/quad_math/quad.h +++ b/sys/quad_math/quad.h @@ -53,6 +53,11 @@ #include #include + +#ifdef __cplusplus +extern "C" { +#endif + typedef char ___QUAD_ASSERT__LENGHTS[sizeof (long long) == 2*sizeof (int) ? +1 : -1]; typedef char ___QUAD_ASSERT__2COMPLEMENT[-1234 == (~1234 + 1) ? +1 : -1]; @@ -138,3 +143,7 @@ int __ucmpdi2(u_quad_t, u_quad_t); u_quad_t __udivdi3(u_quad_t, u_quad_t ); u_quad_t __umoddi3(u_quad_t, u_quad_t ); quad_t __xordi3(quad_t, quad_t); + +#ifdef __cplusplus +} +#endif