Skip to content

Commit

Permalink
[shell] Fixed wrong condition for mbedtls include
Browse files Browse the repository at this point in the history
Changed if defined() to if statement to fix missing mbedtls
header file for platforms using CHIP_CRYPTO_MBEDTLS = false
  • Loading branch information
kkasperczyk-no committed Oct 31, 2023
1 parent 356b626 commit c8320be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/shell/commands/Stat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <crypto/CryptoBuildConfig.h>
#endif // CHIP_HAVE_CONFIG_H

#if defined(CHIP_CRYPTO_MBEDTLS)
#if CHIP_CRYPTO_MBEDTLS
#include <mbedtls/memory_buffer_alloc.h>
#endif

Expand Down Expand Up @@ -54,7 +54,7 @@ CHIP_ERROR StatPeakHandler(int argc, char ** argv)
streamer_printf(streamer_get(), "Heap allocated bytes: %u\r\n", static_cast<unsigned>(heapWatermark));
}

#if defined(CHIP_CRYPTO_MBEDTLS) && defined(MBEDTLS_MEMORY_DEBUG)
#if CHIP_CRYPTO_MBEDTLS && defined(MBEDTLS_MEMORY_DEBUG)
size_t maxUsed = 0;
size_t maxBlocks = 0;

Expand All @@ -81,7 +81,7 @@ CHIP_ERROR StatResetHandler(int argc, char ** argv)
ReturnErrorOnFailure(DeviceLayer::GetDiagnosticDataProvider().ResetWatermarks());
}

#if defined(CHIP_CRYPTO_MBEDTLS) && defined(MBEDTLS_MEMORY_DEBUG)
#if CHIP_CRYPTO_MBEDTLS && defined(MBEDTLS_MEMORY_DEBUG)
mbedtls_memory_buffer_alloc_max_reset();
#endif

Expand Down

0 comments on commit c8320be

Please sign in to comment.