[FFmpeg-devel] [PATCH] move intrax8 tables from a header to a C file

Aurelien Jacobs aurel
Mon Nov 12 01:31:45 CET 2007


Benoit Fouet wrote:

> Rich Felker wrote:
> > On Sat, Nov 10, 2007 at 02:38:22PM +0100, Aurelien Jacobs wrote:
> >   
> >> On Sat, 10 Nov 2007 14:05:05 +0100
> >> Diego Biurrun <diego at biurrun.de> wrote:
> >>
> >>     
> >>> AFAIU it is preferred to have tables in C files rather than in header
> >>> files.
> >>>       
> >> Prefered by whom ? Not by me.
> >> At least not for tables which are not shared between several compilation
> >> units.
> >>     
> >
> > A table shared between compilation units still does not belong in a
> > header. An extern declaration for it belongs in the header, and the
> > table itself belongs in a .c file.
> 
> and what if this c file is not compiled, whereas another c file that
> uses this file, is compiled ?

This should never happen because the Makefile must contain something like:
  OBJS-$(CONFIG_SOMETHING)   += something.o tables.o
if something.c uses some tables from tables.c.

Aurel




More information about the ffmpeg-devel mailing list