glthread: Fix use of alloca() without #include "c99_alloca.h"
authorJon Turney <jon.turney@dronecode.org.uk>
Wed, 6 May 2020 15:09:56 +0000 (16:09 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 12 May 2020 14:46:12 +0000 (14:46 +0000)
commit38cc649fcb54baf87a974ca2dc29d92b50c86cfa
tree5ea5a5774cd4d4d9fd07095dbc8ebd825bfa1e38
parentdc6c42dc77e4bf0cb07037e038c4a50afa5a8143
glthread: Fix use of alloca() without #include "c99_alloca.h"

../src/mesa/main/glthread_draw.c: In function ‘_mesa_marshal_MultiDrawElementsBaseVertex’:
../src/mesa/main/glthread_draw.c:812:36: error: implicit declaration of function ‘alloca’; did you mean ‘malloc’? [-Werror=implicit-function-declaration]
  812 |       const GLvoid **out_indices = alloca(sizeof(indices[0]) * draw_count);
      |                                    ^~~~~~
      |                                    malloc
../src/mesa/main/glthread_draw.c:812:36: error: initialization of ‘const GLvoid **’ {aka ‘const void **’} from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
cc1: some warnings being treated as errors

Include c99_alloca.h to portably make the alloca() prototype available.

Fixes: 2840bc30
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4920>
src/mesa/main/glthread_draw.c