The recent rearrangement of header inclusion order caused a regression
showing segfaults on 32bit Arm. The primary reason is the
inconsistent compile condition depending on the inclusion of config.h;
while most of other code include pcm_local.h (that implicitly includes
config.h) at first, pcm_direct.c doesn't do it, hence the access with
direct plugins crashes.
For fixing it, we need to include config.h at the beginning. But,
it's better to include pcm_local.h for all relevant code for
consistency. The patch does it, and also it adds the guard in
pcm_local.h for double inclusions.
Fixes: ad3a8b8b314e ("reshuffle included files to include config.h as first")
Link: https://github.com/alsa-project/alsa-lib/issues/352
Signed-off-by: Takashi Iwai <tiwai@suse.de>
*
*/
+#include "pcm_local.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
*
*/
-#include "config.h"
+#include "pcm_local.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
*
*/
+#include "pcm_local.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
*
*/
+#include "pcm_local.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
*
*/
+#ifndef __PCM_LOCAL_H
+#define __PCM_LOCAL_H
+
#include "config.h"
#include <stdio.h>
#define snd_pcm_lock(pcm) do {} while (0)
#define snd_pcm_unlock(pcm) do {} while (0)
#endif /* THREAD_SAFE_API */
+
+#endif /* __PCM_LOCAL_H */
*
*/
+#include "pcm_local.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>