3
빈 응용 프로그램에서 충당을 사용하는 것이
#define max(x, y) (x > y ? x : y)
#define min(x, y) (x < y ? x : y)
, 지금은 FreeBSD의 에서 컴파일하려고 내가 점점 계속 :
/usr/include/c++/4.2/bits/istream.tcc:123:35: error: macro "min" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:124:45: error: macro "max" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:143:33: error: macro "min" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:144:43: error: macro "max" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:438:48: error: macro "max" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:441:53: error: macro "min" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:449:47: error: macro "max" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:489:48: error: macro "max" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:493:53: error: macro "min" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:501:47: error: macro "max" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:507:53: error: macro "max" requires 2 arguments, but only 1 given
/usr/include/c++/4.2/bits/istream.tcc:806:43: error: macro "max" requires 2 arguments, but only 1 given
나는 코드 (매크로)의 메소드 이름을 추측합니다.
이제 이름이 많이 변경되었습니다.
어떻게 계속 사용합니까?하지만 컴파일러가 혼합되지 않도록 할 수 있습니까?
매크로를 어떻게 부르나요? –
먼저 시스템 포함 파일을 포함하고, #undefining min 및 max 및 레거시 포함 파일을 마지막으로 포함하는 방법은 어떻습니까? –