<html><body>
<p>Changes required to compile DTC under Cygwin<br>
<br>
<tt>===================================================================</tt><br>
<tt>--- dtc-org.orig/tests/supernode_atdepth_offset.c</tt><br>
<tt>+++ dtc-org/tests/supernode_atdepth_offset.c</tt><br>
<tt>@@ -63,8 +63,11 @@ int path_prefix(const char *path, int de</tt><br>
<tt> return 1;</tt><br>
<br>
<tt> p = path;</tt><br>
<tt>- for (i = 0; i < depth; i++)</tt><br>
<tt>- p = strchrnul(p+1, '/');</tt><br>
<tt>+ for (i = 0; i < depth; i++) {</tt><br>
<tt>+ p = strchr(p+1, '/');</tt><br>
<tt>+ if (!p)</tt><br>
<tt>+ p = path + strlen(path);</tt><br>
<tt>+ }</tt><br>
<br>
<tt> return p - path;</tt><br>
<tt> }</tt><br>
<tt>Index: dtc-org/tests/testutils.c</tt><br>
<tt>===================================================================</tt><br>
<tt>--- dtc-org.orig/tests/testutils.c</tt><br>
<tt>+++ dtc-org/tests/testutils.c</tt><br>
<tt>@@ -52,10 +52,9 @@ static void sigint_handler(int signum, s</tt><br>
<tt> void test_init(int argc, char *argv[])</tt><br>
<tt> {</tt><br>
<tt> int err;</tt><br>
<tt>- struct sigaction sa_int = {</tt><br>
<tt>- .sa_sigaction = sigint_handler,</tt><br>
<tt>- };</tt><br>
<tt>+ struct sigaction sa_int;</tt><br>
<br>
<tt>+ sa_int.sa_sigaction = sigint_handler,</tt><br>
<tt> test_name = argv[0];</tt><br>
<br>
<tt> err = sigaction(SIGINT, &sa_int, NULL);</tt><br>
<tt>Index: dtc-org/tests/trees.S</tt><br>
<tt>===================================================================</tt><br>
<tt>--- dtc-org.orig/tests/trees.S</tt><br>
<tt>+++ dtc-org/tests/trees.S</tt><br>
<tt>@@ -17,10 +17,16 @@</tt><br>
<tt> .byte ((val) >> 8) & 0xff ; \</tt><br>
<tt> .byte (val) & 0xff</tt><br>
<br>
<tt>+#ifdef __CYGWIN__</tt><br>
<tt>+#define TREE_SYMBOL(tree) __##tree</tt><br>
<tt>+#else</tt><br>
<tt>+#define TREE_SYMBOL(tree) _##tree</tt><br>
<tt>+#endif</tt><br>
<tt>+</tt><br>
<tt> #define TREE_HDR(tree) \</tt><br>
<tt> .balign 4 ; \</tt><br>
<tt>- .globl _##tree ; \</tt><br>
<tt>-_##tree: \</tt><br>
<tt>+ .globl TREE_SYMBOL(tree); \</tt><br>
<tt>+TREE_SYMBOL(tree): \</tt><br>
<tt> tree: \</tt><br>
<tt> FDTLONG(FDT_MAGIC) ; \</tt><br>
<tt> FDTLONG(tree##_end - tree) ; \</tt><br>
<tt>Index: dtc-org/tests/tests.h</tt><br>
<tt>===================================================================</tt><br>
<tt>--- dtc-org.orig/tests/tests.h</tt><br>
<tt>+++ dtc-org/tests/tests.h</tt><br>
<tt>@@ -130,4 +130,15 @@ const void *check_getprop(void *fdt, int</tt><br>
<tt> void *load_blob_arg(int argc, char *argv[]);</tt><br>
<tt> void save_blob(const char *filename, void *blob);</tt><br>
<br>
<tt>+#ifndef GLIBC</tt><br>
<tt>+#define strndupa(my_str, my_len) \</tt><br>
<tt>+ ({ \</tt><br>
<tt>+ char *new_str=alloca((my_len) + 1); \</tt><br>
<tt>+ strncpy(new_str, my_str, my_len); \</tt><br>
<tt>+ new_str[my_len]='\0'; \</tt><br>
<tt>+ new_str; \</tt><br>
<tt>+ })</tt><br>
<tt>+</tt><br>
<tt>+#endif</tt><br>
<tt>+</tt><br>
<tt> #endif /* _TESTS_H */</tt><br>
<br>
<br>
Matt Tyrlik </body></html>