From 82c787ec3b0dc4ddc54639ad47eb82a052446858 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 18 Oct 2017 18:46:23 -0700 Subject: Fix build on Integrity: the compiler doesn't understand this construct "global/qrandom.cpp", line 155: error #2000-D: attribute "destructor" is not implemented and will be ignored Task-number: QTBUG-63948 Change-Id: Icaa86fc7b54d4b368c0efffd14efa35381d4e797 Reviewed-by: Liang Qi Reviewed-by: Lars Knoll --- src/corelib/global/qrandom.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index 3ae7e3bad8..0bbe79aeb4 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -152,7 +152,11 @@ class SystemRandom { static QBasicAtomicInt s_fdp1; // "file descriptor plus 1" static int openDevice(); - static __attribute__((destructor)) void closeDevice(); // assume GCC or a compiler able to understand GCC extensions +#ifdef Q_CC_GNU + // If it's not GCC or GCC-like, then we'll leak the file descriptor + __attribute__((destructor)) +#endif + static void closeDevice(); SystemRandom() {} public: enum { EfficientBufferFill = true }; -- cgit v1.2.3