]> git.alsa-project.org Git - alsa-lib.git/commit
Fix alsa/sound/*.h for external programs
authorTakashi Iwai <tiwai@suse.de>
Fri, 20 Dec 2019 14:46:48 +0000 (15:46 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 20 Dec 2019 15:43:50 +0000 (16:43 +0100)
commitae564665ec261cf104de499b1cdda3564070fc65
treee21cd66f6b870c3e88fd333c7b6c73ecb4cdaddc
parent780f17126aa8d54fc09694cbf652d4135eb731c0
Fix alsa/sound/*.h for external programs

The recent update of sound/*.h to sync with the latest Linus uapi
files broke the build of alsa-tools programs.  These files used to be
a modified version of Linux sound/* header files, so that they could
be built without Linux headers.  The special prefix like __user and
other things were worked around there.

We may do that again, but a better approach is to fix those things in
Linux kernel uapi side, while we keep the minimal workaround in
alsa-lib such as the __u16 and co type definitions.

This patch is such an attempt, namely:
- Keep the original $LINUX/uapi/sound/*.h in include/sound/uapi
  directory
- The "fixes" are applied to some uapi headers, so that they don't
  contain Linux-specific prefix and use of opaque struct like
  snd_ctl_elem_id
- The uapi headers are included indirectly from include/sound/*.h
- Some headers have inclusion of type_compat.h for the Linux variable
  types and prefixes
- type_compat.h tries to use <linux/types.h> when __linux__ is
  defined, instead of the own conflicting definitions

The last type might need a bit more adjustment depending on the
compiler, but it can be fixed locally without disturbing else.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
25 files changed:
configure.ac
include/sound/Makefile.am
include/sound/asequencer.h
include/sound/asoc.h
include/sound/asound.h
include/sound/asound_fm.h
include/sound/emu10k1.h
include/sound/hdsp.h
include/sound/hdspm.h
include/sound/sb16_csp.h
include/sound/sscape_ioctl.h
include/sound/tlv.h
include/sound/type_compat.h
include/sound/uapi/Makefile.am [new file with mode: 0644]
include/sound/uapi/asequencer.h [new file with mode: 0644]
include/sound/uapi/asoc.h [new file with mode: 0644]
include/sound/uapi/asound.h [new file with mode: 0644]
include/sound/uapi/asound_fm.h [new file with mode: 0644]
include/sound/uapi/emu10k1.h [new file with mode: 0644]
include/sound/uapi/hdsp.h [new file with mode: 0644]
include/sound/uapi/hdspm.h [new file with mode: 0644]
include/sound/uapi/sb16_csp.h [new file with mode: 0644]
include/sound/uapi/sscape_ioctl.h [new file with mode: 0644]
include/sound/uapi/tlv.h [new file with mode: 0644]
src/topology/tplg_local.h