Coverage Report

Created: 2026-09-28 08:21

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/qtbase/src/3rdparty/harfbuzz-ng/config.h
Line
Count
Source
1
/*
2
* Copyright (C) 2015 The Qt Company Ltd.
3
* Copyright (C) 2015 Konstantin Ritt
4
*
5
* Permission is hereby granted, without written agreement and without
6
* license or royalty fees, to use, copy, modify, and distribute this
7
* software and its documentation for any purpose, provided that the
8
* above copyright notice and the following two paragraphs appear in
9
* all copies of this software.
10
*
11
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
12
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
13
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
14
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
15
* DAMAGE.
16
*
17
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
18
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
* FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
20
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
21
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
22
*
23
*/
24
25
#ifndef QHARFBUZZ_CONFIG_H
26
#define QHARFBUZZ_CONFIG_H
27
28
#include <QtCore/qatomic.h>
29
30
QT_USE_NAMESPACE
31
32
namespace {
33
34
// We need to cast hb_atomic_int_t to QAtomicInt and pointers to
35
// QAtomicPointer instead of using QAtomicOps, otherwise we get a failed
36
// overload resolution of the template arguments for testAndSetOrdered.
37
template <typename T>
38
inline QAtomicPointer<T> *makeAtomicPointer(T * const &ptr)
39
0
{
40
0
    return reinterpret_cast<QAtomicPointer<T> *>(const_cast<T **>(&ptr));
41
0
}
42
43
static inline void _hb_memory_barrier ()
44
0
{
45
0
    QAtomicInt a;
46
0
    a.ref(); // Ordered memory semantics, so imposes a memory barrier at this point
47
0
}
Unexecuted instantiation: hb-shape.cc:(anonymous namespace)::_hb_memory_barrier()
Unexecuted instantiation: hb-buffer-verify.cc:(anonymous namespace)::_hb_memory_barrier()
Unexecuted instantiation: hb-buffer-serialize.cc:(anonymous namespace)::_hb_memory_barrier()
48
49
} // namespace
50
51
typedef int hb_atomic_int_impl_t;
52
#define HB_ATOMIC_INT_IMPL_INIT(V)             (V)
53
#define hb_atomic_int_impl_add(AI, V)          reinterpret_cast<QAtomicInt *>(AI)->fetchAndAddOrdered(V)
54
55
#define hb_atomic_ptr_impl_get(P)              makeAtomicPointer(*(P))->loadAcquire()
56
#define hb_atomic_ptr_impl_cmpexch(P,O,N)      makeAtomicPointer(*(P))->testAndSetOrdered((O), (N))
57
58
#endif // QHARFBUZZ_CONFIG_H