Maybe you should try cpp?
/usr/ccs/lib/cpp or man cpp.
It's the old C preprocessor (pre C89, I think).
There is also m4.

Peter.

On Wed, 2009-12-16 at 10:24, Vincent Torri wrote:
> Hey,
> 
> We have a text file that has a specific format, and which can  contain
> C macro. We use then the preprocessor to replace the macros by their
> content.
> 
> On opensolaris, the behavior of the preprocessor is different from the
> one from gcc.
> 
> Exemple:
> 
> The text file has the following content (without [code] and [/code]):
> 
> [code]
> 
> #define ICON(NAME, FILE, SIZE)                      \
> group { name: "e/icons/"NAME ;                      \
>     image.image: FILE COMP;                     \
> }
> 
> //Standard Action Icons
> ICON("help-about","logo_black_128.png",64)                      //
> "enlightenment/about"
> 
> [/code]
> 
> I name that file test.edc. I call the preprocessor like that:
> 
> cc -E -I/export/home/torri/code/edje -o test_cpp.edc test.edc
> 
> the result in test_cpp.edc is (without [code] and [/code]):
> 
> [code]
> 
> # 1 "test.edc"
> 
> # 6
> 
>  
>  group { name : "e/icons/" "help-about" ; image . image :
> "logo_black_128.png" COMP ; }                       
> #ident "acomp: Sun C 5.10 SunOS_i386 2009/06/03"
> 
> [/code]
> 
> The problem, here, is that the preprocessor is adding space before and
> after the dot:
> 
> image . image
> 
> which is actually *very* annoying for us (at least on opensolaris :-)
> ).
> 
> My questions are:
> 
> 1) is that behavior normal ?
> 2) if not,  is there a way to make the preprocessor not adding those
> spaces ?
> 
> thank you
> 
> Vincent Torri
> 
> 
> ______________________________________________________________________
> _______________________________________________
> tools-compilers mailing list
> tools-compilers at opensolaris.org

Reply via email to