MSDN 에서 Predefined Macros 로 찾으니 쉽게 찾아 졌다.
흥배님께서 언급한 두 개의 매크로 외에 __FUNCDNAME__ 라는 녀석도 있었다. 이들의 쓰인 결과를 보면 어떤 역할을 하는 매크로 인지 쉽게 알 수 있다.
아래 코드는 MSDN에서 발췌한 코드 이다. MSDN의 Predefined Macros 페이지에 보다 다양한 매크로에 대해 설명 하고 있다.
// Demonstrates functionality of __FUNCTION__, __FUNCDNAME__, and __FUNCSIG__ macros
void exampleFunction()
{
printf("Function name: %s\n", __FUNCTION__);
printf("Decorated function name: %s\n", __FUNCDNAME__);
printf("Function signature: %s\n", __FUNCSIG__);
// Sample Output
// -------------------------------------------------
// Function name: exampleFunction
// Decorated function name: ?exampleFunction@@YAXXZ
// Function signature: void __cdecl exampleFunction(void)
}
Predefined Macros on MSD
Original Post : http://neodreamer-dev.tistory.com/584
No comments :
Post a Comment