Debian Codegraph @

src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/pal/mbed_os5/refcount_os.h

raw
1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4 // This file gets included into refcount.h as a means of extending the behavior of
5 // atomic increment, decrement, and test.
6 //
7 // The Azure IoT C SDK does not require thread-safe refcount operations, so
8 // this file is appropriate for any device when using the Azure IoT C SDK.
9
10 #ifndef REFCOUNT_OS_H__GENERIC
11 #define REFCOUNT_OS_H__GENERIC
12
13 #define COUNT_TYPE uint32_t
14
15 #define DEC_RETURN_ZERO (0)
16
17 #define INC_REF_VAR(count) ++(count)
18 #define DEC_REF_VAR(count) --(count)
19 #define INIT_REF_VAR(count) do { count = 1; } while((void)0,0)
20
21 #endif // REFCOUNT_OS_H__GENERIC