diff --git a/sdk/core/azure-core/inc/azure.hpp b/sdk/core/azure-core/inc/azure.hpp index 5696533b3..acab08b8b 100644 --- a/sdk/core/azure-core/inc/azure.hpp +++ b/sdk/core/azure-core/inc/azure.hpp @@ -3,6 +3,8 @@ #pragma once +#include + namespace azure { namespace core diff --git a/sdk/core/azure-core/inc/internal/contract.hpp b/sdk/core/azure-core/inc/internal/contract.hpp new file mode 100644 index 000000000..891e9f821 --- /dev/null +++ b/sdk/core/azure-core/inc/internal/contract.hpp @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +#pragma once + +#ifdef NO_CONTRACTS_CHECKING +#define AZ_CONTRACT(condition, error) +#define AZ_CONTRACT_ARG_NOT_NULL(arg) +#else +#define AZ_CONTRACT(condition, error) \ + do \ + { \ + if (!(condition)) \ + { \ + return error; \ + } \ + } while (0) + +#define AZ_CONTRACT_ARG_NOT_NULL(arg) AZ_CONTRACT((arg) != NULL, 1) + +#endif