Skip to contentSkip to conversation

Include <alloca.h> when needed before calling alloca

PATCH:libdrm Alan Coopersmith 2 participants 2 messages Sep 6, 2015

lore
Share & tools
lore
#0 lore raw

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

---
 amdgpu/amdgpu_cs.c         |    3 +++
 tests/amdgpu/basic_tests.c |    3 +++
 2 files changed, 6 insertions(+)
amdgpu/amdgpu_cs.c +3 -0
index c7910ad..4da9821 100644
@@ -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"
tests/amdgpu/basic_tests.c +3 -0
index 7874039..e489e6e 100644
@@ -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"
 
Signature · 6 lines
1.7.9.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by
#1 lore raw

Marek

Quoted 40 lines · Alan Coopersmith

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

---
 amdgpu/amdgpu_cs.c         |    3 +++
 tests/amdgpu/basic_tests.c |    3 +++
 2 files changed, 6 insertions(+)
amdgpu/amdgpu_cs.c +3 -0
index c7910ad..4da9821 100644
@@ -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"
tests/amdgpu/basic_tests.c +3 -1
index 7874039..e489e6e 100644
@@ -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"
 
--

1.7.9.2

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel