Hallow. i intended use c++ with avr-libc and so i provide a patch to allow use FDEV_SETUP_STREAM marco in c++ sources. since c++ does not support designated indexes, it need to use different intialiser(less stricted) for fdev structure.

=== modified file 'stdio.h'
--- stdio.h     2010-02-23 21:19:28 +0000
+++ stdio.h     2010-02-23 21:20:19 +0000
@@ -384,6 +384,19 @@
  */
 #define FDEV_SETUP_STREAM(put, get, rwflag)
 #else  /* !DOXYGEN */
+#ifdef __cplusplus
+#define FDEV_SETUP_STREAM(p, g, f) \
+       {\
+        0  \
+               , 0 \
+        , f \
+        , 0 \
+        , 0 \
+        , p \
+               , g \
+               , 0 \
+       }
+#else
 #define FDEV_SETUP_STREAM(p, g, f) \
        { \
                .put = p, \
@@ -391,6 +404,7 @@
                .flags = f, \
                .udata = 0, \
        }
+#endif
 #endif /* DOXYGEN */
 
 #ifdef __cplusplus

_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to