4.2. __declspec 속성

__declspec 키워드를 사용하면 객체 및 함수의 특별한 속성을 지정할 수 있습니다. 예를 들어 __declspec 키워드를 사용하여 가져오거나 내보낸 함수 및 변수를 선언하거나 TLS(Thread Local Storage) 객체를 선언할 수 있습니다.

__declspec 키워드는 선언 사양의 접두사로 추가되어야 합니다. 예를 들면 다음과 같습니다.

__declspec(noreturn) void overflow(void);
__declspec(thread) int i;

Table 4.2에는 사용 가능한 __declspec 속성이 요약되어 있습니다. __declspec 속성은 저장소 클래스 한정자입니다. 함수 또는 변수의 유형에 영향을 주지 않습니다.

Table 4.2. 컴파일러에서 지원하는 __declspec 속성 및 해당 항목

__declspec 속성__declspec가 아닌 해당 항목
__declspec(dllexport)-
__declspec(dllimport)-
__declspec(noinline)__attribute__((noinline))
__declspec(noreturn)__attribute__((noreturn))
__declspec(nothrow)-
__declspec(notshared)-
__declspec(thread)-

Copyright © 2007-2009 ARM Limited. All rights reserved.ARM DUI 0348BK
Non-Confidential