include: misc: util.h: Rename min/max to MIN/MAX

There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.

This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.

All files that use these macros have been updated.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
This commit is contained in:
Carlos Stuart 2019-02-11 17:14:19 +00:00 committed by Anas Nashif
commit 75f77db432
106 changed files with 229 additions and 229 deletions

View file

@ -614,7 +614,7 @@ void log_output_dropped_process(const struct log_output *log_output, u32_t cnt)
log_output_func_t outf = log_output->func;
struct device *dev = (struct device *)log_output->control_block->ctx;
cnt = min(cnt, 9999);
cnt = MIN(cnt, 9999);
len = snprintf(buf, sizeof(buf), "%d", cnt);
buffer_write(outf, (u8_t *)prefix, sizeof(prefix) - 1, dev);