[FFmpeg-devel] _t POSIX namespace issues

Aurelien Jacobs aurel
Thu Dec 11 21:35:30 CET 2008


Diego Biurrun wrote:

> On Thu, Dec 11, 2008 at 06:39:11PM +0100, Michael Niedermayer wrote:
> > On Thu, Dec 11, 2008 at 05:33:57PM +0100, Diego Biurrun wrote:
> > > On Thu, Dec 11, 2008 at 09:43:02AM +0000, M?ns Rullg?rd wrote:
> > > > Diego Biurrun <diego at biurrun.de> writes:
> > > > 
> > > > > So names ending in _t are reserved by POSIX.  Nonetheless we have tons
> > > > > of them.  I thought about fixing these issues myself, but coming up with
> > > > > good new names is tedious, so I propose to have each maintainer address
> > > > > the problem in the files they maintain.  Here is a the result of a grep
> > > > > for problematic names with maintainers, in no particular order:
> > > > 
> > > > > libpostproc/postprocess.h:typedef void pp_context_t;
> > > > > libpostproc/postprocess.h:typedef void pp_mode_t;
> > > > 
> > > > Typedeffing things as void or void * is just silly.
> > > 
> > > True, here is a patch that addresses this.  I fear this might need a
> > > major version bump, though...
> > 
> > it should be changed to code like AVMD5 in libavutil/md5.h
> > its a lot better to have named types than void* .
> > and the _t could just be dropped
> 
> Like this then?
> 
> [...]
> 
> Index: libpostproc/postprocess.h
> ===================================================================
> --- libpostproc/postprocess.h	(revision 16056)
> +++ libpostproc/postprocess.h	(working copy)
> @@ -54,8 +54,8 @@
>  
>  #include <inttypes.h>
>  
> -typedef void pp_context_t;
> -typedef void pp_mode_t;
> +typedef void pp_context;
> +typedef void pp_mode;

This breaks public API !
You must at least provide a compatibility typedef such as:

#if LIBPOSTPROC_VERSION_INT < (52<<16)
typedef pp_context pp_context_t;
typedef pp_mode pp_mode_t;
#endif

Aurel




More information about the ffmpeg-devel mailing list