|combining c-code files into one c-code file email@example.com (Harald Gustafsson) (2012-04-03)|
|Re: combining c-code files into one c-code file firstname.lastname@example.org (Cameron McInally) (2012-04-04)|
|Re: combining c-code files into one c-code file email@example.com (Harald Gustafsson) (2012-04-04)|
|Re: combining c-code files into one c-code file firstname.lastname@example.org (Gene) (2012-04-09)|
|Re: combining c-code files into one c-code file email@example.com (Harald Gustafsson) (2012-04-18)|
|From:||Harald Gustafsson <firstname.lastname@example.org>|
|Date:||Tue, 3 Apr 2012 06:23:24 -0700 (PDT)|
|Keywords:||C, tools, question|
|Posted-Date:||04 Apr 2012 10:41:11 EDT|
I'm trying to convert libx264 to Android's renderscript as an exercise in how
much work it is to port a bit larger project into renderscript. One of the
pains with renderscript is that the complete executable needs to be declared
within the same file scope (can't easily access functions or constants in
other files) and functions and global variables needs to be declared static to
not automatically get a java interface. Renderscript is C99 compliant.
I started to just include all the c-code files into one renderscript-file and
compile that. Which would had worked quite easily if not libx264 itself had
also included c-files with different pre-processing macro definitions, hence
some functions exist twice with different content and some are redeclared
identical. I could of course handle this manually with many days of work, but
it would be easier with a tool.
I'm asking if anyone knows of a tool that can take a list of c-files and
pre-process/merge that into one c-file, managing redeclarations, conflicting
declarations, declaration order, etc. The readability of the output is less
important but prefers as human readable as possible.
An alternative is to have one file scope but separate each included c-file
into its own namespace, does C99 have any such support?
Return to the
Search the comp.compilers archives again.