diff options
author | Nicolas Schodet <nico@ni.fr.eu.org> | 2012-09-02 19:12:58 +0400 |
---|---|---|
committer | Nicolas Schodet <nico@ni.fr.eu.org> | 2012-09-02 19:12:58 +0400 |
commit | 3aab6220d83d5b9fcd318e9d87225ff405cad783 (patch) | |
tree | b61019429043b03b091ce00f84b312829abd0e94 /include/libopencm3/cm3/common.h | |
parent | 11727f56c97fb3d007e0d08e59294b6791067bd1 (diff) |
Add C linkage declaration for C++ usage
Diffstat (limited to 'include/libopencm3/cm3/common.h')
-rw-r--r-- | include/libopencm3/cm3/common.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/libopencm3/cm3/common.h b/include/libopencm3/cm3/common.h index 54cd2e43..7ef18fea 100644 --- a/include/libopencm3/cm3/common.h +++ b/include/libopencm3/cm3/common.h @@ -32,6 +32,16 @@ typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; +/* This must be placed around external function declaration for C++ + * support. */ +#ifdef __cplusplus +# define BEGIN_DECLS extern "C" { +# define END_DECLS } +#else +# define BEGIN_DECLS +# define END_DECLS +#endif + /* Generic memory-mapped I/O accessor functions */ #define MMIO8(addr) (*(volatile u8 *)(addr)) #define MMIO16(addr) (*(volatile u16 *)(addr)) |