Commit 2b71f5f2 authored by Thiago Macieira's avatar Thiago Macieira Committed by The Qt Project
Browse files

Fix compilation under precompiled headers: define _CRT_RAND_S


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: default avatarSergio Ahumada <sahumada@blackberry.com>
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
Showing with 2 additions and 0 deletions
...@@ -41,6 +41,8 @@ DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF ...@@ -41,6 +41,8 @@ DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF
win32-* { win32-* {
# Prevent definition of min, max macros in windows.h # Prevent definition of min, max macros in windows.h
DEFINES+=NOMINMAX DEFINES+=NOMINMAX
# Enables rand_s
msvc: DEFINES += _CRT_RAND_S
LIBS_PRIVATE += -lwinmm LIBS_PRIVATE += -lwinmm
} }
contains(JAVASCRIPTCORE_JIT,yes) { contains(JAVASCRIPTCORE_JIT,yes) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment