Tip & Tech

#pragma macro_push, macro_pop

blueasa 2010. 10. 21. 17:38

 "d3dx9math.h"를 include할때 이전에 정의되어있는 'new'때문에 에러가 발생했다.

그렇다고 기본new를 그냥 undef하고 사용하기는 찝찝해서 아래와 같이 잠깐동안만 기본new를 undef하고

다시 선언하는 방법을 사용해 에러를 없앴다.

 

// 이전의 new를 저장했다 다시 디파인
#pragma push_macro("new") // 기본new를 저장
#undef new // 기본new를 삭제
#include "d3dx9math.h" // 이 파일에 같은 이름의 new 매크로가 존재
#pragma pop_macro("new") //  저장해둔 기본new를 로드



출처 : http://blog.naver.com/nkein82?Redirect=Log&logNo=100088967998

반응형