aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Butcher <simon.butcher@arm.com>2018-10-01 14:05:25 +0100
committerSimon Butcher <simon.butcher@arm.com>2019-01-13 15:02:06 +0000
commit924819ea7b3cfd61f66eb7454d44f4d1dca956ce (patch)
tree00588a60c54c2490d300e62acc63eda4e71a87d2
parent78f040cf333e8f2938b4581f11a015e474a4a250 (diff)
downloadmbedtls-archive/config-header-check-2.7.zip
mbedtls-archive/config-header-check-2.7.tar.gz
mbedtls-archive/config-header-check-2.7.tar.bz2
Add check for multiple config files being definedarchive/config-header-check-2.7
Add check to check_config.h to ensure MBEDTLS_USER_CONFIG_FILE cannot be defined if MBEDTLS_CONFIG_FILE is defined. If both are defined MBEDTLS_USER_CONFIG_FILE will not be included, which may confuse users.
-rw-r--r--include/mbedtls/check_config.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h
index fa7110f..301b283 100644
--- a/include/mbedtls/check_config.h
+++ b/include/mbedtls/check_config.h
@@ -30,6 +30,10 @@
#ifndef MBEDTLS_CHECK_CONFIG_H
#define MBEDTLS_CHECK_CONFIG_H
+#if defined(MBEDTLS_CONFIG_FILE) && defined(MBEDTLS_USER_CONFIG_FILE)
+#error "MBEDTLS_USER_CONFIG_FILE cannot be included if MBEDTLS_CONFIG_FILE is defined."
+#endif
+
/*
* We assume CHAR_BIT is 8 in many places. In practice, this is true on our
* target platforms, so not an issue, but let's just be extra sure.