2011-04-28 4 views
0

_THROW 매크로가 GCC4에서 정의 된 위치 또는 수동으로 정의하는 방법을 알려주십시오._THROW는 GCC에서 정의되지 않았습니까?

#include <stdio.h> 
#include <stdlib.h> 
#include <stdarg.h> 
#include <assert.h> 
#include <ctype.h> 
#include <climits> 
#include <stdexcept> 
#include <sys/cdefs.h> 
#include <sys/types.h> 

void test() { _THROW(std::range_error,"Test"); } 
+7

'_THROW' 표준 C++의 일부가 아닙니다. 왜''std :: range_error ("Test");'를 쓰지 않겠습니까? –

답변

3

그것을 정의 위치를 ​​알려주세요 컴파일러 관련 내부 매크로 매크로는 사용하지 마십시오. 당신이 을 정의해야하는 경우


, 여기 당신은 간다 :

#define _THROW(e, ...) throw e(__VA_ARGS__) 
관련 문제