misc: Add extern "C" blocks to headers
authorJakob Gruber <jakob.gruber@gmail.com>
Fri, 27 Jul 2012 11:46:28 +0000 (13:46 +0200)
committerJakob Gruber <jakob.gruber@gmail.com>
Tue, 31 Jul 2012 11:06:00 +0000 (13:06 +0200)
Most headers already had these. This commit adds them where they weren't
included yet.

16 files changed:
simavr/sim/avr_adc.h
simavr/sim/avr_bitbang.c
simavr/sim/avr_eeprom.h
simavr/sim/avr_extint.h
simavr/sim/avr_flash.h
simavr/sim/avr_ioport.h
simavr/sim/avr_lin.h
simavr/sim/avr_spi.h
simavr/sim/avr_timer.h
simavr/sim/avr_twi.h
simavr/sim/avr_uart.h
simavr/sim/avr_usb.h
simavr/sim/avr_watchdog.h
simavr/sim/fifo_declare.h
simavr/sim/sim_avr_types.h
simavr/sim/sim_time.h

index eaf78ee..e1e75d1 100644 (file)
 #ifndef __AVR_ADC_H___
 #define __AVR_ADC_H___
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 /*
@@ -142,4 +146,8 @@ void avr_adc_init(avr_t * avr, avr_adc_t * port);
                .kind = ADC_MUX_VCC4, \
        }
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* __AVR_ADC_H___ */
index 1bee186..254c95a 100644 (file)
        along with simavr.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -233,3 +237,7 @@ void avr_bitbang_stop(avr_bitbang_t * p)
        avr_cycle_timer_cancel(p->avr, avr_bitbang_clk_timer, p);
        avr_irq_unregister_notify( avr_io_getirq(p->avr, AVR_IOCTL_IOPORT_GETIRQ( p->p_clk.port ), p->p_clk.pin), avr_bitbang_clk_hook, p);
 }
+
+#ifdef __cplusplus
+};
+#endif
index 6176b0c..ae301af 100644 (file)
 #ifndef __AVR_EEPROM_H__
 #define __AVR_EEPROM_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 typedef struct avr_eeprom_t {
@@ -120,4 +124,8 @@ typedef struct avr_eeprom_desc_t {
                },\
        }
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* __AVR_EEPROM_H__ */
index fce4fa4..57519d0 100644 (file)
 #ifndef AVR_EXTINT_H_
 #define AVR_EXTINT_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 
@@ -86,4 +90,8 @@ void avr_extint_init(avr_t * avr, avr_extint_t * p);
                        }, \
                }
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* AVR_EXTINT_H_ */
index dffaeaf..7714250 100644 (file)
 #ifndef __AVR_FLASH_H___
 #define __AVR_FLASH_H___
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 /*
@@ -61,4 +65,8 @@ void avr_flash_init(avr_t * avr, avr_flash_t * p);
                },\
        }
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* __AVR_FLASH_H___ */
index bc090b2..c6f5a4b 100644 (file)
 #ifndef __AVR_IOPORT_H__
 #define __AVR_IOPORT_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 enum {
@@ -92,4 +96,8 @@ typedef struct avr_ioport_t {
 void avr_ioport_init(avr_t * avr, avr_ioport_t * port);
 
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* __AVR_IOPORT_H__ */
index b27c88d..b1ecadf 100644 (file)
 #ifndef __AVR_LIN_H__
 #define __AVR_LIN_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 #include "avr_uart.h"
 
@@ -44,4 +48,8 @@ avr_lin_init(
                avr_t *avr,
                avr_lin_t *port);
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* __AVR_LIN_H__ */
index 3e3a26a..4a8eaf0 100644 (file)
 #ifndef AVR_SPI_H_
 #define AVR_SPI_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 enum {
@@ -53,4 +57,8 @@ typedef struct avr_spi_t {
 
 void avr_spi_init(avr_t * avr, avr_spi_t * port);
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* AVR_SPI_H_ */
index 39362d4..4e92318 100644 (file)
 #ifndef AVR_TIMER_H_
 #define AVR_TIMER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 enum {
@@ -124,4 +128,8 @@ typedef struct avr_timer_t {
 
 void avr_timer_init(avr_t * avr, avr_timer_t * port);
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* AVR_TIMER_H_ */
index 6b30c34..e21e3b6 100644 (file)
 #ifndef AVR_TWI_H_
 #define AVR_TWI_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 //#include "sim_twi.h"
@@ -103,4 +107,8 @@ avr_twi_irq_msg(
                uint8_t addr,
                uint8_t data);
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* AVR_TWI_H_ */
index f0ff4af..d21c36f 100644 (file)
 #ifndef AVR_UART_H_
 #define AVR_UART_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 #include "fifo_declare.h"
@@ -117,4 +121,8 @@ typedef struct avr_uart_t {
 
 void avr_uart_init(avr_t * avr, avr_uart_t * port);
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* AVR_UART_H_ */
index 609ffb6..842e423 100644 (file)
 #ifndef AVR_USB_H_
 #define AVR_USB_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 enum {
@@ -63,4 +67,8 @@ typedef struct avr_usb_t {
 
 void avr_usb_init(avr_t * avr, avr_usb_t * port);
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* AVR_USB_H_ */
index e31d3bb..0620b7f 100644 (file)
@@ -23,6 +23,9 @@
 #ifndef __AVR_WATCHDOG_H___
 #define __AVR_WATCHDOG_H___
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #include "sim_avr.h"
 
@@ -80,4 +83,8 @@ void avr_watchdog_init(avr_t * avr, avr_watchdog_t * p);
                },\
        }
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* __AVR_WATCHDOG_H___ */
index 44deb39..bbacb3a 100644 (file)
 #ifndef __FIFO_DECLARE__
 #define __FIFO_DECLARE__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
        doing a :
        DECLARE_FIFO(uint8_t, myfifo, 128);
@@ -154,4 +158,8 @@ static FIFO_INLINE void __name##_reset(__name##_t *c)\
 }\
 struct __name##_t
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif
index 638d68f..b15bafc 100644 (file)
 #ifndef __SIM_AVR_TYPES_H___
 #define __SIM_AVR_TYPES_H___
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 #include <inttypes.h>
 
@@ -46,4 +50,8 @@ typedef struct avr_regbit_t {
 
 struct avr_t;
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* __SIM_AVR_TYPES_H___ */
index fa1106f..fd17174 100644 (file)
 #ifndef __SIM_TIME_H___
 #define __SIM_TIME_H___
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "sim_avr.h"
 
 // converts a number of usec to a number of machine cycles, at current speed
@@ -49,4 +53,8 @@ static inline avr_cycle_count_t avr_hz_to_cycles(avr_t * avr, uint32_t hz)
        return avr->frequency / hz;
 }
 
+#ifdef __cplusplus
+};
+#endif
+
 #endif /* __SIM_TIME_H___ */