[Spice-commits] 2 commits - common/snd_codec.c common/snd_codec.h m4/spice-deps.m4 meson.build
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Feb 7 10:58:57 UTC 2020
common/snd_codec.c | 10 +++++++++-
common/snd_codec.h | 9 ---------
m4/spice-deps.m4 | 16 ++--------------
meson.build | 6 ------
4 files changed, 11 insertions(+), 30 deletions(-)
New commits:
commit 26d3f6e13837681c3f63349c155304101ad45ab6
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Wed Nov 27 13:02:26 2019 +0000
build: Clean up some configure checks
Remove some system checks.
Specifically:
- functions in the standard C (memset, memmove);
- functions we use but we assume in the specific implementation
present (dup2, fork);
- functions we don't use (error_at_line);
- headers in the standard C (stddef.h, stdint.h, string.h);
- headers present in all systems we support if are not checked
in the source files (malloc.h);
- types we assume being present (XintYY_t, pid_t).
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index c4a16e7..53255e1 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
@@ -35,26 +35,14 @@ AM_COND_IF([ENABLE_EXTRA_CHECKS], AC_DEFINE([ENABLE_EXTRA_CHECKS], 1, [Enable ex
AC_DEFUN([SPICE_CHECK_SYSDEPS], [
AC_C_BIGENDIAN
AC_FUNC_ALLOCA
- AC_CHECK_HEADERS([arpa/inet.h malloc.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h unistd.h])
+ AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdlib.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics
AC_C_INLINE
- AC_TYPE_INT16_T
- AC_TYPE_INT32_T
- AC_TYPE_INT64_T
- AC_TYPE_INT8_T
- AC_TYPE_PID_T
- AC_TYPE_SIZE_T
- AC_TYPE_UINT16_T
- AC_TYPE_UINT32_T
- AC_TYPE_UINT64_T
- AC_TYPE_UINT8_T
# Checks for library functions
# do not check malloc or realloc, since that cannot be cross-compiled checked
- AC_FUNC_ERROR_AT_LINE
- AC_FUNC_FORK
- AC_CHECK_FUNCS([dup2 floor memmove memset])
+ AC_CHECK_FUNCS([floor])
AC_SEARCH_LIBS([hypot], [m], [], [
AC_MSG_ERROR([unable to find the hypot() function])
])
diff --git a/meson.build b/meson.build
index 05091fb..fd6133b 100644
--- a/meson.build
+++ b/meson.build
@@ -54,14 +54,8 @@ headers = ['alloca.h',
'arpa/inet.h',
'dlfcn.h',
'inttypes.h',
- 'malloc.h',
- 'memory.h',
'netinet/in.h',
- 'stddef.h',
- 'stdint.h',
'stdlib.h',
- 'strings.h',
- 'string.h',
'sys/socket.h',
'sys/stat.h',
'sys/types.h',
commit f3d6c5f3228d54efe890e3fd096b8e80ac116871
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Tue Nov 26 16:40:20 2019 +0000
snd_codec: Do not include not needed headers
Include headers required for implementation only in the
implementation file.
This remove dependency and avoid the user component having to
check for header flags (in this case HAVE_CELT051 and HAVE_OPUS).
This make easier integration in other components.
This also make compilation faster.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/common/snd_codec.c b/common/snd_codec.c
index e54ef3f..5fb0bb5 100644
--- a/common/snd_codec.c
+++ b/common/snd_codec.c
@@ -31,10 +31,18 @@
#include "config.h"
#include <stdio.h>
#include <string.h>
+
+#if HAVE_CELT051
+#include <celt051/celt.h>
+#endif
+
+#if HAVE_OPUS
+#include <opus.h>
+#endif
+
#include <spice/macros.h>
#include <spice/enums.h>
-
#include "snd_codec.h"
#include "mem.h"
#include "log.h"
diff --git a/common/snd_codec.h b/common/snd_codec.h
index a5be8d6..596b2d3 100644
--- a/common/snd_codec.h
+++ b/common/snd_codec.h
@@ -19,15 +19,6 @@
#ifndef H_SPICE_COMMON_SND_CODEC
#define H_SPICE_COMMON_SND_CODEC
-
-#if HAVE_CELT051
-#include <celt051/celt.h>
-#endif
-
-#if HAVE_OPUS
-#include <opus.h>
-#endif
-
/* Spice uses a very fixed protocol when transmitting CELT audio;
audio must be transmitted in frames of 256, and we must compress
data down to a fairly specific size (47, computation below).
More information about the Spice-commits
mailing list