Include <alloca.h> when needed before calling alloca

Fixes "error: implicit declaration of function 'alloca'" failures
when building on Solaris

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
main
Alan Coopersmith 2015-09-06 09:34:31 -07:00
parent 8983fe5497
commit 94ecdcb8b1
2 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,9 @@
#include <pthread.h> #include <pthread.h>
#include <sched.h> #include <sched.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#endif
#include "xf86drm.h" #include "xf86drm.h"
#include "amdgpu_drm.h" #include "amdgpu_drm.h"

View File

@ -28,6 +28,9 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#endif
#include "CUnit/Basic.h" #include "CUnit/Basic.h"