* [FFmpeg-devel] [PATCH] avutil/cpu: #define _GNU_SOURCE before including any standard headers
@ 2022-04-14 21:20 Marton Balint
2022-04-20 18:00 ` Marton Balint
0 siblings, 1 reply; 2+ messages in thread
From: Marton Balint @ 2022-04-14 21:20 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Marton Balint
Otherwise its effect might not work causing CPU_COUNT to not get defined.
Fixes cpu count detection to actually use sched_getaffinity if available.
Signed-off-by: Marton Balint <cus@passwd.hu>
---
libavutil/cpu.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 833c220192..24b99d2554 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -16,6 +16,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
+
+#if HAVE_SCHED_GETAFFINITY
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
+#include <sched.h>
+#endif
+
#include <stddef.h>
#include <stdint.h>
#include <stdatomic.h>
@@ -23,16 +32,9 @@
#include "attributes.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
--
2.31.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avutil/cpu: #define _GNU_SOURCE before including any standard headers
2022-04-14 21:20 [FFmpeg-devel] [PATCH] avutil/cpu: #define _GNU_SOURCE before including any standard headers Marton Balint
@ 2022-04-20 18:00 ` Marton Balint
0 siblings, 0 replies; 2+ messages in thread
From: Marton Balint @ 2022-04-20 18:00 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Thu, 14 Apr 2022, Marton Balint wrote:
> Otherwise its effect might not work causing CPU_COUNT to not get defined.
>
> Fixes cpu count detection to actually use sched_getaffinity if available.
Will apply tomorrow.
Regards,
Marton
>
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> libavutil/cpu.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/libavutil/cpu.c b/libavutil/cpu.c
> index 833c220192..24b99d2554 100644
> --- a/libavutil/cpu.c
> +++ b/libavutil/cpu.c
> @@ -16,6 +16,15 @@
> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> +#include "config.h"
> +
> +#if HAVE_SCHED_GETAFFINITY
> +#ifndef _GNU_SOURCE
> +# define _GNU_SOURCE
> +#endif
> +#include <sched.h>
> +#endif
> +
> #include <stddef.h>
> #include <stdint.h>
> #include <stdatomic.h>
> @@ -23,16 +32,9 @@
> #include "attributes.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
> --
> 2.31.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-20 18:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-14 21:20 [FFmpeg-devel] [PATCH] avutil/cpu: #define _GNU_SOURCE before including any standard headers Marton Balint
2022-04-20 18:00 ` Marton Balint
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git