[gjs/wip/lantw/include-alloca-h-conditionally] profiler: Don't include alloca.h when disabled
- From: Ting-Wei Lan <lantw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/lantw/include-alloca-h-conditionally] profiler: Don't include alloca.h when disabled
- Date: Thu, 15 Feb 2018 19:55:51 +0000 (UTC)
commit 968abe28af1f504ff94fafb08ecf139527d5b98f
Author: Ting-Wei Lan <lantw src gnome org>
Date: Fri Feb 16 03:42:33 2018 +0800
profiler: Don't include alloca.h when disabled
alloca is a non-standard feature. It is possible for a system to put it
in a different header, so including alloca.h unconditionally may cause
compilation error. Since we only need alloca when this Linux-only
profiler is enabled, we can simply move the include to the ifdef block.
gjs/profiler.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gjs/profiler.cpp b/gjs/profiler.cpp
index 5f03dca6..5749fcfa 100644
--- a/gjs/profiler.cpp
+++ b/gjs/profiler.cpp
@@ -24,7 +24,6 @@
#include <config.h>
#include <algorithm>
-#include <alloca.h>
#include <errno.h>
#include <memory>
#include <signal.h>
@@ -41,6 +40,7 @@
#include "jsapi-util.h"
#include "profiler-private.h"
#ifdef ENABLE_PROFILER
+# include <alloca.h>
# include "util/sp-capture-writer.h"
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]