too few arguments provided to function-like macro invocation

3.2k views Asked by At

My project successfully compiles on the Win32 platform. Now I have to turn off the 'classic Borland compiler' because I'd like to use Designated Initializers like this:

struct test_s test = { .first = 1, .third = 3, .second = 2 };

When the 'classic Borland compiler' is turned off, I've got the following error message;

[bcc32c Error] codecvt(131): too few arguments provided to function-like macro invocation
  std_compat.h(7): macro 'max' defined here

I have the same problem on the Win64 target.

My project compiles without problems in C++Builder 10.1, but when I try to compile in 10.4, I have this problem.

How can I fix it?

1

There are 1 answers

1
jsmith On

The problem is solved by removing the following include from some of my include files and using it from cpp only. However it works in 10.1 and very simple .

//- contents of std_compat.h -----------------------------------------------------

#ifndef std_compatH
#define std_compatH

#define min( a, b ) (a) < (b) ? (a) : (b)
#define max( a, b ) (a) > (b) ? (a) : (b)

#endif