[Tinyos-devel] [PATCH] Make uisp compile on Cygwin 1.7.2+

Romain Bornet bornet.romain at gmail.com
Wed Nov 3 06:15:11 PDT 2010


Hi all,

I'm new in TOS community and just installed and built the sources as
documented on http://docs.tinyos.net/index.php/Installing_from_CVS/GIT

I'm currently forced to work on Windows 7 :-( and had some trouble
during the compile of uisp with latest Cygwin 1.7.7.
The conflict came from incompatible declarations and implementations
of cfmakeraw() in tools/platforms/mica/uisp/src/cygwinp.C and .h
cfmakeraw() was integrated in Cygwin libc as of Cygwin 1.7.2 see
http://www.cygwin.com/cygwin-ug-net/ov-new1.7.html

This patch makes uisp compile without error also on Cygwin >=1.7.2.
I'll submit this patch to uisp project but it seems that the project
is no longer maintained and users are advised to move to avrdude.
I personnally don't need uisp and could avoid to compile it but it can
help others using mica or other Atmel platforms.

Thanks and see you
    Romain
---

Index: tools/platforms/mica/uisp/src/cygwinp.C
===================================================================
--- tools/platforms/mica/uisp/src/cygwinp.C (revision 5210)
+++ tools/platforms/mica/uisp/src/cygwinp.C (working copy)
@@ -34,6 +34,7 @@
 #include <w32api/windows.h>
 #include "cygwinp.h"
 #include "DAPA.h"
+#include <cygwin/version.h>

 unsigned char inb(unsigned short port)
 {
@@ -103,7 +104,8 @@
     }
 }

-
+/* cfmakeraw() defined in Cygwin's libc for Cygwin >= 1.7.2 */
+# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 2)
 int cfmakeraw(struct termios *termios_p)
 {
     termios_p->c_iflag &=
@@ -114,5 +116,6 @@
     termios_p->c_cflag |= CS8;
     return 0;
 }
+#endif

 #endif
Index: tools/platforms/mica/uisp/src/cygwinp.h
===================================================================
--- tools/platforms/mica/uisp/src/cygwinp.h (revision 5210)
+++ tools/platforms/mica/uisp/src/cygwinp.h (working copy)
@@ -31,5 +31,13 @@
 unsigned char inb(unsigned short port);
 void outb(unsigned char value, unsigned short port);
 int ioperm(unsigned short port, int num, int enable);
+
+/* cfmakeraw() is declared in termios.h in Cygwin >= 1.7.2 */
+#ifdef __CYGWIN__
+#include <cygwin/version.h>
+# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 2)
 int cfmakeraw(struct termios *termios_p);
+#endif
+#endif
+
 bool cygwinp_delay_usec(long t);



More information about the Tinyos-devel mailing list