On Thu, 25 Aug 2011, Michael Stefaniuc wrote:

> Hello,
> 
> is there a way in coccinelle to force a macro expansion or even better
> substitution?
> 
> Problem: The Win32 API has this:
> include/basetyps.h:# define interface struct
> 
> And there is code in Wine that misuses that. While adding that to my
> macro file makes the code parse I cannot modify that code nor do the
> rules that look for "struct foo" match "interface foo". In SmPL pseudo
> (and invalid) code I'm looking for something that does:
> @@
> macro interface;
> @@
> - interface
> + struct
> 
> Just using perl (interface is a very common word in the comments) or
> removing/modifying the define (it is used in macro expansion (API) as
> well in generated code from IDL) is very tedious and I wonder if there
> is a cleaner way to achieve it; preferably in coccinelle.

I'm not seeing anything very obvious.  The problem is that the SmPL code 
doesn't take into account the macro definition file.  So it won't know 
what to do with interface.

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to