[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: widl [1/6]: Generate names for tagless structs, unions and enums
From:       Alexandre Julliard <julliard () winehq ! org>
Date:       2006-08-29 10:31:47
Message-ID: 87hczvq1d8.fsf () wine ! dyndns ! org
[Download RAW message or body]

Dan Hipschman <dsh@linux.ucla.edu> writes:

> +static char *gen_name(void)
> +{
> +  static const char format[] = "__WIDL_%s_generated_name_%08lX";
> +  static unsigned long n = 0;
> +
> +  size_t size = sizeof format - 7 + strlen(input_base) + 8;
> +  char *name = xmalloc(size);
> +
> +  sprintf(name, format, input_base, n++);
> +  return name;
> +}

You can't simply copy the file name, there's no guarantee it's a valid
C identifier. You should use something like make_c_identifier in
winebuild.

-- 
Alexandre Julliard
julliard@winehq.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic