[Mesa-dev] [PATCH 2/6] ddebug: record and dump apitrace call numbers
Jon Turney
jon.turney at dronecode.org.uk
Tue Jul 5 10:13:38 UTC 2016
On 01/07/2016 00:21, Marek Olšák wrote:
[...]
> diff --git a/src/gallium/drivers/ddebug/dd_util.h b/src/gallium/drivers/ddebug/dd_util.h
> index 093bdff..3649644 100644
> --- a/src/gallium/drivers/ddebug/dd_util.h
> +++ b/src/gallium/drivers/ddebug/dd_util.h
> @@ -71,4 +71,27 @@ dd_get_debug_file(bool verbose)
> return f;
> }
>
> +static inline void
> +dd_parse_apitrace_marker(const char *string, int len, unsigned *call_number)
> +{
> + unsigned num;
> + char *s;
> +
> + if (len <= 0)
> + return;
> +
> + /* Make it zero-terminated. */
> + s = alloca(len + 1);
This adds a use of alloca(), without a corresponding #include <alloca.h>
This fails to build, for me:
> In file included from dd_pipe.h:34:0,
> from dd_screen.c:28:
> dd_util.h: In function 'dd_parse_apitrace_marker':
> dd_util.h:84:4: error: implicit declaration of function 'alloca' [-Werror=implicit-function-declaration]
> s = alloca(len + 1);
Perhaps the attached is needed?
-------------- next part --------------
From 5f606bff8e5ed92a42956c10ee6b2b77360feaf5 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney at dronecode.org.uk>
Date: Tue, 5 Jul 2016 10:40:05 +0100
Subject: [PATCH] Add alloca.h include to fix compilation on Cygwin
Fix compilation on Cygwin, since 50b22354, by adding #include <alloca.h>
Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
---
src/gallium/drivers/ddebug/dd_util.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gallium/drivers/ddebug/dd_util.h b/src/gallium/drivers/ddebug/dd_util.h
index 3649644..9b9b3e0 100644
--- a/src/gallium/drivers/ddebug/dd_util.h
+++ b/src/gallium/drivers/ddebug/dd_util.h
@@ -28,6 +28,7 @@
#ifndef DD_UTIL_H
#define DD_UTIL_H
+#include <alloca.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
--
2.8.3
More information about the mesa-dev
mailing list