OSDN Git Service

Include <alloca.h> when needed before calling alloca
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Sun, 6 Sep 2015 16:34:31 +0000 (09:34 -0700)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Sat, 12 Sep 2015 16:41:24 +0000 (09:41 -0700)
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>
amdgpu/amdgpu_cs.c
tests/amdgpu/basic_tests.c

index c7910ad..4da9821 100644 (file)
@@ -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"
index 7874039..e489e6e 100644 (file)
@@ -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"