DTC Patch for Cygwin

Scott Wood scottwood at freescale.com
Sat Sep 22 04:46:39 EST 2007


On Fri, Sep 21, 2007 at 11:26:04AM -0400, Matt Tyrlik wrote:
> 
> Changes required to compile DTC under Cygwin
> 
> ===================================================================
> --- dtc-org.orig/tests/supernode_atdepth_offset.c
> +++ dtc-org/tests/supernode_atdepth_offset.c
> @@ -63,8 +63,11 @@ int path_prefix(const char *path, int de
>                 return 1;
> 
>         p = path;
> -       for (i = 0; i < depth; i++)
> -               p = strchrnul(p+1, '/');
> +       for (i = 0; i < depth; i++) {
> +               p = strchr(p+1, '/');
> +               if (!p)
> +                       p = path + strlen(path);
> +       }
> 
>         return p - path;
>  }

Maybe we should define strchrnul under #ifndef GLIBC, similar to
strndupa?

> Index: dtc-org/tests/testutils.c
> ===================================================================
> --- dtc-org.orig/tests/testutils.c
> +++ dtc-org/tests/testutils.c
> @@ -52,10 +52,9 @@ static void sigint_handler(int signum, s
>  void test_init(int argc, char *argv[])
>  {
>         int err;
> -       struct sigaction sa_int = {
> -               .sa_sigaction = sigint_handler,
> -       };
> +       struct sigaction sa_int;
> 
> +       sa_int.sa_sigaction = sigint_handler,
>         test_name = argv[0];

What version of GCC does cygwin use?  That doesn't seem like something
that should break due to OS differences.

-Scott



More information about the Linuxppc-dev mailing list