Diff of /include/iomacros.h [383b4a] .. [550813]  Maximize  Restore

Switch to side-by-side view

--- a/include/iomacros.h
+++ b/include/iomacros.h
@@ -38,18 +38,16 @@
 #endif
 
 #ifdef __cplusplus
+#define __MSP430_LIBC_C_LINKAGE__ "C"
+#else
+#define __MSP430_LIBC_C_LINKAGE__
+#endif
+
 #ifndef NAKED
 #define NAKED(x) \
-extern "C" void x(void); \
+extern __MSP430_LIBC_C_LINKAGE__ void x(void); \
 void x (void) __attribute__ ((naked)); \
 void x (void)
-#endif
-#else
-#ifndef NAKED
-#define NAKED(x) \
-void x (void) __attribute__ ((naked)); \
-void x (void)
-#endif
 #endif
 
 #define Critical __attribute__ ((critical))
@@ -134,9 +132,9 @@
 
 #elif __GNUC__ >= 4
 
-extern void __bis_sr_irq(int);
-extern void __bic_sr_irq(int);
-extern void *__get_frame_address(void);
+extern __MSP430_LIBC_C_LINKAGE__ void __bis_sr_irq(int);
+extern __MSP430_LIBC_C_LINKAGE__ void __bic_sr_irq(int);
+extern __MSP430_LIBC_C_LINKAGE__ void *__get_frame_address(void);
 
 #define _BIS_SR_IRQ(x)                  __bis_sr_irq(x)
 #define _BIC_SR_IRQ(x)                  __bic_sr_irq(x)
@@ -204,29 +202,16 @@
 
 #endif
 
-#ifdef __cplusplus
-    #define sfrb_(x,x_) \
-	    extern "C" volatile unsigned char x asm(#x_)
+#define sfrb_(x,x_) \
+    extern __MSP430_LIBC_C_LINKAGE__ volatile unsigned char x asm(#x_)
     
-    #define sfrw_(x,x_) \
-	    extern "C" volatile unsigned int x asm(#x_)
+#define sfrw_(x,x_) \
+    extern __MSP430_LIBC_C_LINKAGE__ volatile unsigned int x asm(#x_)
 
 #if defined(__MSP430X__) || defined(__MSP430X2__)
-    #define sfra_(x,x_) \
-	    extern "C" volatile unsigned long int x asm(#x_)
-#endif
-#else //__cplusplus
-    #define sfrb_(x,x_) \
-	    volatile unsigned char x asm(#x_)
-    
-    #define sfrw_(x,x_) \
-	    volatile unsigned int x asm(#x_)
-
-#if defined(__MSP430X__) || defined(__MSP430X2__)
-    #define sfra_(x,x_) \
-	    volatile unsigned long int x asm(#x_)
-#endif
-#endif //__cplusplus
+#define sfra_(x,x_) \
+    extern __MSP430_LIBC_C_LINKAGE__ volatile unsigned long int x asm(#x_)
+#endif
 
 #define sfrb(x,x_) sfrb_(x,x_)
 

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks