[FFmpeg-devel] [PATCH 2/2] avutil/cpu-test: Add includes from cpu.c

Michael Niedermayer michael at niedermayer.cc
Thu May 12 03:48:39 CEST 2016


On Wed, May 11, 2016 at 07:05:22PM -0300, James Almer wrote:
> On 5/11/2016 5:34 PM, Michael Niedermayer wrote:
> > config.h is needed for HAVE_*
> > config.h alone breaks build
> > some of the added includes may be unneccesary
> > 
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavutil/cpu-test.c |   33 ++++++++++++++++++++++++---------
> >  1 file changed, 24 insertions(+), 9 deletions(-)
> > 
> > diff --git a/libavutil/cpu-test.c b/libavutil/cpu-test.c
> > index 3eca6d2..52a82bc 100644
> > --- a/libavutil/cpu-test.c
> > +++ b/libavutil/cpu-test.c
> > @@ -16,19 +16,34 @@
> >   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> >   */
> >  
> > -#include <stdio.h>
> > -#include "avstring.h"
> > -
> > -#if !HAVE_GETOPT
> > -#include "compat/getopt.c"
> > -#endif
> > -
> >  #include <stdint.h>
> > -#include <stdio.h>
> >  
> >  #include "avstring.h"
> > -#include "common.h"
> >  #include "cpu.h"
> > +#include "cpu_internal.h"
> > +#include "config.h"
> > +#include "opt.h"
> > +#include "common.h"
> > +
> > +#if HAVE_SCHED_GETAFFINITY
> > +#ifndef _GNU_SOURCE
> > +# define _GNU_SOURCE
> > +#endif
> > +#include <sched.h>
> > +#endif
> > +#if HAVE_GETPROCESSAFFINITYMASK || HAVE_WINRT
> > +#include <windows.h>
> > +#endif
> > +#if HAVE_SYSCTL
> > +#if HAVE_SYS_PARAM_H
> > +#include <sys/param.h>
> > +#endif
> > +#include <sys/types.h>
> > +#include <sys/sysctl.h>
> > +#endif
> > +#if HAVE_UNISTD_H
> > +#include <unistd.h>
> > +#endif
> >  
> >  static const struct {
> >      int flag;
> 
> Most of those are only needed for the internal bits in cpu.c
> Try instead
> 
> diff --git a/libavutil/cpu-test.c b/libavutil/cpu-test.c
> index 3eca6d2..35e7631 100644
> --- a/libavutil/cpu-test.c
> +++ b/libavutil/cpu-test.c
> @@ -17,19 +17,18 @@
>   */
> 
>  #include <stdio.h>
> +
> +#include "config.h"
> +#include "cpu.h"
>  #include "avstring.h"
> 
> +#if HAVE_UNISTD_H
> +#include <unistd.h>
> +#endif
>  #if !HAVE_GETOPT
>  #include "compat/getopt.c"
>  #endif
> 
> -#include <stdint.h>
> -#include <stdio.h>
> -
> -#include "avstring.h"
> -#include "common.h"
> -#include "cpu.h"
> -
>  static const struct {
>      int flag;
>      const char *name;
> 
> Compiles fine for me on mingw-w64 and ArchLinux, but you have access to more
> varied machines.

applied

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160512/c883c64e/attachment.sig>


More information about the ffmpeg-devel mailing list