Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #548

combining c-code files into one c-code file

From Harald Gustafsson <harald.gustafsson@gmail.com>
Newsgroups comp.compilers
Subject combining c-code files into one c-code file
Date 2012-04-03 06:23 -0700
Organization Compilers Central
Message-ID <12-04-005@comp.compilers> (permalink)

Show all headers | View raw


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?

Regards,
  Harald

Back to comp.compilers | Previous | NextNext in thread | Find similar


Thread

combining c-code files into one c-code file Harald Gustafsson <harald.gustafsson@gmail.com> - 2012-04-03 06:23 -0700
  Re: combining c-code files into one c-code file Cameron McInally <cameron.mcinally@nyu.edu> - 2012-04-04 12:02 -0400
  Re: combining c-code files into one c-code file Harald Gustafsson <harald.gustafsson@gmail.com> - 2012-04-04 19:35 +0200
  Re: combining c-code files into one c-code file Gene <gene.ressler@gmail.com> - 2012-04-09 05:40 -0700
  Re: combining c-code files into one c-code file Harald Gustafsson <harald.gustafsson@gmail.com> - 2012-04-18 02:01 -0700

csiph-web