From c25b9fe1d2444f961dc1fce655c1dbcdc55f0b9f Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 8 Feb 2013 09:30:40 +0100 Subject: [PATCH] Fix alloca usage on Windows On Windows it's _alloca, so provide a wrapping macro in qv4alloca_p.h and use that instead. Change-Id: I675cb7fd09bab3c84c44e56819c0f17a42b3c211 Reviewed-by: Lars Knoll --- src/v4/moth/qv4vme_moth.cpp | 2 +- src/v4/qv4alloca_p.h | 42 ++++++++++++++++++++++++++++++++++++++++++ src/v4/qv4functionobject.cpp | 2 +- src/v4/qv4globalobject.cpp | 2 +- src/v4/qv4mm.cpp | 2 +- src/v4/qv4object.cpp | 2 +- src/v4/qv4regexpobject.cpp | 2 +- 7 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 src/v4/qv4alloca_p.h diff --git a/src/v4/moth/qv4vme_moth.cpp b/src/v4/moth/qv4vme_moth.cpp index 1cfaf64..8ed3fb1 100644 --- a/src/v4/moth/qv4vme_moth.cpp +++ b/src/v4/moth/qv4vme_moth.cpp @@ -5,7 +5,7 @@ #include -#include +#include "qv4alloca_p.h" #ifdef DO_TRACE_INSTR # define TRACE_INSTR(I) fprintf(stderr, "executing a %s\n", #I); diff --git a/src/v4/qv4alloca_p.h b/src/v4/qv4alloca_p.h new file mode 100644 index 0000000..d3fdae6 --- /dev/null +++ b/src/v4/qv4alloca_p.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef QV4_ALLOCA_H +#define QV4_ALLOCA_H + +#include + +#if defined(Q_OS_WIN) +#include +#define alloca _alloca +#else +#include +#endif + +#endif diff --git a/src/v4/qv4functionobject.cpp b/src/v4/qv4functionobject.cpp index 2d96f92..02f76a7 100644 --- a/src/v4/qv4functionobject.cpp +++ b/src/v4/qv4functionobject.cpp @@ -59,7 +59,7 @@ #include #include #include -#include +#include "qv4alloca_p.h" using namespace QQmlJS::VM; diff --git a/src/v4/qv4globalobject.cpp b/src/v4/qv4globalobject.cpp index 86d8c38..5020258 100644 --- a/src/v4/qv4globalobject.cpp +++ b/src/v4/qv4globalobject.cpp @@ -55,7 +55,7 @@ #include #include #include -#include +#include "qv4alloca_p.h" #include diff --git a/src/v4/qv4mm.cpp b/src/v4/qv4mm.cpp index f29381b..2724700 100644 --- a/src/v4/qv4mm.cpp +++ b/src/v4/qv4mm.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include "qv4alloca_p.h" using namespace QQmlJS::VM; using namespace WTF; diff --git a/src/v4/qv4object.cpp b/src/v4/qv4object.cpp index 5e57c89..f260762 100644 --- a/src/v4/qv4object.cpp +++ b/src/v4/qv4object.cpp @@ -60,7 +60,7 @@ #include #include #include -#include +#include "qv4alloca_p.h" using namespace QQmlJS::VM; diff --git a/src/v4/qv4regexpobject.cpp b/src/v4/qv4regexpobject.cpp index 0240830..8319a0c 100644 --- a/src/v4/qv4regexpobject.cpp +++ b/src/v4/qv4regexpobject.cpp @@ -59,7 +59,7 @@ #include #include #include -#include +#include "qv4alloca_p.h" using namespace QQmlJS::VM; -- 2.7.4