summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-09-06 09:34:31 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-09-12 09:41:24 -0700
commit94ecdcb8b11dd3eb6b047ad72030d775014aadee (patch)
tree7142ce3761f82cab73711d65be5975220d4d841c
parent8983fe5497e89a3ffaba3ad1ee06a30a1c7e6daf (diff)
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>
-rw-r--r--amdgpu/amdgpu_cs.c3
-rw-r--r--tests/amdgpu/basic_tests.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index c7910ada..4da98214 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -32,6 +32,9 @@
#include <pthread.h>
#include <sched.h>
#include <sys/ioctl.h>
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
#include "xf86drm.h"
#include "amdgpu_drm.h"
diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
index 78740393..e489e6e8 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -28,6 +28,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
#include "CUnit/Basic.h"