Page 1 of 1

C++: TDM-GCC: minimising includes

Posted: 14 Dec 2018, 16:40
by jeeswg
- I was wondering about any issues relating to minimising the number of included files in C++ code, for when compiling machine code.
- I noticed that min is not a built-in function, so I've replaced:
min(a, b)
with:
a < b ? a : b
The same applies to max. I wondered if other people add the include, or change the code, or use macros even, and whether there are other little issues like this. Thanks.
- I believe the include for the max/min functions is #include "windows.h"

Re: C++: TDM-GCC: minimising includes

Posted: 14 Dec 2018, 17:22
by nnnik
Yes there are many issues. I have summarized a few of the problems in my MCode tutorial.