azure-core
Loading...
Searching...
No Matches
contract.hpp
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#pragma once
5
6#if defined(NO_CONTRACTS_CHECKING)
7#define AZ_CONTRACT(condition, error)
8#define AZ_CONTRACT_ARG_NOT_NULL(arg)
9#else
10#define AZ_CONTRACT(condition, error) \
11 do \
12 { \
13 if (!(condition)) \
14 { \
15 return error; \
16 } \
17 } while (0)
18
19#define AZ_CONTRACT_ARG_NOT_NULL(arg) AZ_CONTRACT((arg) != NULL, 1)
20
21#endif