Fix alloca usage on Windows
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 8 Feb 2013 08:30:40 +0000 (09:30 +0100)
committerLars Knoll <lars.knoll@digia.com>
Sat, 9 Feb 2013 09:49:43 +0000 (10:49 +0100)
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 <lars.knoll@digia.com>
src/v4/moth/qv4vme_moth.cpp
src/v4/qv4alloca_p.h [new file with mode: 0644]
src/v4/qv4functionobject.cpp
src/v4/qv4globalobject.cpp
src/v4/qv4mm.cpp
src/v4/qv4object.cpp
src/v4/qv4regexpobject.cpp

index 1cfaf64..8ed3fb1 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <iostream>
 
-#include <alloca.h>
+#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 (file)
index 0000000..d3fdae6
--- /dev/null
@@ -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 <qglobal.h>
+
+#if defined(Q_OS_WIN)
+#include <malloc.h>
+#define alloca _alloca
+#else
+#include <alloca.h>
+#endif
+
+#endif
index 2d96f92..02f76a7 100644 (file)
@@ -59,7 +59,7 @@
 #include <cassert>
 #include <typeinfo>
 #include <iostream>
-#include <alloca.h>
+#include "qv4alloca_p.h"
 
 using namespace QQmlJS::VM;
 
index 86d8c38..5020258 100644 (file)
@@ -55,7 +55,7 @@
 #include <QtCore/QDebug>
 #include <QtCore/QString>
 #include <iostream>
-#include <alloca.h>
+#include "qv4alloca_p.h"
 
 #include <wtf/MathExtras.h>
 
index f29381b..2724700 100644 (file)
@@ -41,7 +41,7 @@
 
 #include <iostream>
 #include <cstdlib>
-#include <alloca.h>
+#include "qv4alloca_p.h"
 
 using namespace QQmlJS::VM;
 using namespace WTF;
index 5e57c89..f260762 100644 (file)
@@ -60,7 +60,7 @@
 #include <cassert>
 #include <typeinfo>
 #include <iostream>
-#include <alloca.h>
+#include "qv4alloca_p.h"
 
 using namespace QQmlJS::VM;
 
index 0240830..8319a0c 100644 (file)
@@ -59,7 +59,7 @@
 #include <cassert>
 #include <typeinfo>
 #include <iostream>
-#include <alloca.h>
+#include "qv4alloca_p.h"
 
 using namespace QQmlJS::VM;