diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-06-02 13:20:05 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2022-06-08 08:30:45 +0000 |
commit | 3df23b1fe446fbbbc915b7eb5f90e851564bc419 (patch) | |
tree | 9947f7081f31677921faf5d5f36983a68acbf53b /src/testlib/qtestcase.cpp | |
parent | 78c677376a59b5ac59a7dcad18bbe0542ff66db9 (diff) |
Define out unused functions on WASM build
The struct iovec conversion functions that are needed on Unix are
unused on WASM build. This makes the build fail with -Werror on Mac
since the WASM build is treated as a variant of Unix. Cross-compilation
with clang:
Apple clang version 13.0.0 (clang-1300.0.27.3)
Target: arm64-apple-darwin21.3.0
Fixes: QTBUG-103974
Pick-to: 6.3 6.4
Change-Id: I34c65a18832ceedb9064a98f5729e45667749461
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r-- | src/testlib/qtestcase.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index d69bd9d3d1..c702ab125b 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -123,7 +123,7 @@ using QtMiscUtils::fromHex; namespace { enum DebuggerProgram { None, Gdb, Lldb }; -#ifdef Q_OS_UNIX +#if defined(Q_OS_UNIX) && (!defined(Q_OS_WASM) || QT_CONFIG(thread)) static struct iovec IoVec(struct iovec vec) { return vec; @@ -210,7 +210,7 @@ static std::string asyncSafeToString(int n) { return std::to_string(n); } -#endif // Q_OS_UNIX +#endif // defined(Q_OS_UNIX) } // unnamed namespace static bool alreadyDebugging() @@ -353,6 +353,7 @@ static void prepareStackTrace() #endif // Q_OS_UNIX } +#if !defined(Q_OS_WASM) || QT_CONFIG(thread) static void printTestRunTime() { const int msecsFunctionTime = qRound(QTestLog::msecsFunctionTime()); @@ -366,7 +367,7 @@ static void generateStackTrace() if (debugger == None || alreadyDebugging()) return; -#if defined(Q_OS_UNIX) && !defined(Q_OS_WASM) && !defined(Q_OS_INTEGRITY) +# if defined(Q_OS_UNIX) && !defined(Q_OS_WASM) && !defined(Q_OS_INTEGRITY) writeToStderr("\n=== Stack trace ===\n"); // execlp() requires null-termination, so call the default constructor @@ -403,8 +404,9 @@ static void generateStackTrace() } writeToStderr("=== End of stack trace ===\n"); -#endif // Q_OS_UNIX && !Q_OS_WASM +# endif // Q_OS_UNIX && !Q_OS_WASM } +#endif // !defined(Q_OS_WASM) || QT_CONFIG(thread) static bool installCoverageTool(const char * appname, const char * testname) { @@ -1287,7 +1289,7 @@ public: void testFinished() {}; }; -#endif +#endif // QT_CONFIG(thread) /*! |