Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qaudio_rtsan_support_p.h
Go to the documentation of this file.
1
// Copyright (C) 2025 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
ifndef
QAUDIO_RTSAN_SUPPORT_P_H
5
#
define
QAUDIO_RTSAN_SUPPORT_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
<
QtCore
/
qcompilerdetection
.
h
>
19
#
include
<
QtCore
/
qtclasshelpermacros
.
h
>
20
#
include
<
QtCore
/
qtconfigmacros
.
h
>
21
22
#
if
defined
(
__has_feature
)
&&
__has_feature
(
realtime_sanitizer
)
23
#
include
<
sanitizer
/
rtsan_interface
.
h
>
24
#
endif
25
26
QT_BEGIN_NAMESPACE
27
28
namespace
QtPrivate
{
29
30
#
if
defined
(
__has_feature
)
&&
__has_feature
(
realtime_sanitizer
)
31
using
ScopedRTSanDisabler
=
__rtsan
::
ScopedDisabler
;
32
#
else
33
struct
ScopedRTSanDisabler
34
{
35
ScopedRTSanDisabler
()
36
{
37
// silence unused/unreferenced local variable warning
38
// NB: declaring the struct as [[maybe_unused]] does not work for cl.exe
39
(
void
)
this
;
40
}
41
~
ScopedRTSanDisabler
() =
default
;
42
Q_DISABLE_COPY_MOVE
(
ScopedRTSanDisabler
)
43
};
44
#
endif
45
46
template
<
typename
Functor>
47
auto
withRTSanDisabled
(
const
Functor &f)
48
{
49
#
if
defined
(
__has_feature
)
&&
__has_feature
(
realtime_sanitizer
)
50
__rtsan::ScopedDisabler disabler;
51
#
endif
52
return
f();
53
}
54
55
}
// namespace QtPrivate
56
57
QT_END_NAMESPACE
58
59
#
endif
// QAUDIO_RTSAN_SUPPORT_P_H
QtPrivate
Definition
qalloc.h:29
QtPrivate::withRTSanDisabled
auto withRTSanDisabled(const Functor &f)
Definition
qaudio_rtsan_support_p.h:47
__has_feature
#define __has_feature(x)
Definition
qcompilerdetection.h:447
QtPrivate::ScopedRTSanDisabler
Definition
qaudio_rtsan_support_p.h:34
QtPrivate::ScopedRTSanDisabler::~ScopedRTSanDisabler
~ScopedRTSanDisabler()=default
QtPrivate::ScopedRTSanDisabler::ScopedRTSanDisabler
ScopedRTSanDisabler()
Definition
qaudio_rtsan_support_p.h:35
qtmultimedia
src
multimedia
audio
qaudio_rtsan_support_p.h
Generated on
for Qt by
1.16.1