Skip to content

Commit

Permalink
Fix ChipError scope resolution
Browse files Browse the repository at this point in the history
Make sure to unambiguously specify the chip namespace in macros
as they can be evaluated in places where 'chip::' is ambiguous.
  • Loading branch information
mspang committed Sep 13, 2021
1 parent e945d16 commit 9d2f571
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/core/CHIPError.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ class ChipError
* (In C++20 this could be replaced by a consteval constructor.)
*/
#if CHIP_CONFIG_ERROR_SOURCE
#define CHIP_SDK_ERROR(part, code) (::chip::ChipError(chip::ChipError::SdkErrorConstant<(part), (code)>::value, __FILE__, __LINE__))
#define CHIP_SDK_ERROR(part, code) \
(::chip::ChipError(::chip::ChipError::SdkErrorConstant<(part), (code)>::value, __FILE__, __LINE__))
#else // CHIP_CONFIG_ERROR_SOURCE
#define CHIP_SDK_ERROR(part, code) (::chip::ChipError(chip::ChipError::SdkErrorConstant<(part), (code)>::value))
#define CHIP_SDK_ERROR(part, code) (::chip::ChipError(::chip::ChipError::SdkErrorConstant<(part), (code)>::value))
#endif // CHIP_CONFIG_ERROR_SOURCE

/**
Expand Down

0 comments on commit 9d2f571

Please sign in to comment.