summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-05-27 12:50:58 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-02 15:57:19 +0200
commit2b71f5f2ce41deb9baf91df2db9ec568e98814e8 (patch)
treef9724288237c1ead1073dad15325a55ad82e73f6
parent161e1fd31537f41992b3024c32b525b64be080ed (diff)
downloadqtscript-5.3.1.tar.gz
Fix compilation under precompiled headers: define _CRT_RAND_Sv5.3.1stable5.3.1
If the macro _CRT_RAND_S is defined, #include <stdlib.h> will define the rand_s function. All was well before the precompiled headers because wtf/config.h was always the first header included in WTF and it #defined at the right place. With precompiled headers, stdlib.h got included from qglobal.h before the #define took place. This was a latent bug because the non-JSC parts of QtScript could have included RandomNumberSeed.h and caused the error. RandomNumberSeed.h(82) : error C3861: 'rand_s': identifier not found Change-Id: I88b4b8670604b35ca694c02522324ac3083ed2b4 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
index 2298de3..6ee0aed 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
@@ -41,6 +41,8 @@ DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF
win32-* {
# Prevent definition of min, max macros in windows.h
DEFINES+=NOMINMAX
+# Enables rand_s
+ msvc: DEFINES += _CRT_RAND_S
LIBS_PRIVATE += -lwinmm
}
contains(JAVASCRIPTCORE_JIT,yes) {