include: prefer alsa/asoundlib.h for apps, dependency cleanups

Fixes several issues with header files:

- prefer alsa/asoundlib.h file for the alsa-lib core functionalities
  (use #warning to inform current and future developers, do the job)
- include alsa/asoundlib.h in headers for external plugins by default
- pcm_external.h: dependencies cleanup
- as benefit, the parsers in IDEs should get all information for individial
  header files (see PR#435)

This change was mainly tergetted to fix errors caused by wrong include order
(like for endianness detection, missing typedefs etc.).

Closes: https://github.com/alsa-project/alsa-lib/issues/431
Link: https://github.com/alsa-project/alsa-lib/pull/435
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-02-02 13:46:12 +01:00
parent 35d2efefa9
commit ea8972c83b
28 changed files with 150 additions and 25 deletions

View file

@ -26,6 +26,12 @@
*
*/
#if !defined(__ASOUNDLIB_H) && !defined(ALSA_LIBRARY_BUILD)
/* don't use ALSA_LIBRARY_BUILD define in sources outside alsa-lib */
#warning "use #include <alsa/asoundlib.h>, <alsa/pcm.h> should not be used directly"
#include <alsa/asoundlib.h>
#endif
#ifndef __ALSA_PCM_H
#define __ALSA_PCM_H
@ -33,8 +39,6 @@
extern "C" {
#endif
#include <stdint.h>
/**
* \defgroup PCM PCM Interface
* See the \ref pcm page for more details.