29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Compiler</strong>-specific Features<br />

4.2 __declspec attributes<br />

The __declspec keyword enables you to specify special attributes of objects and<br />

functions. For example, you can use the __declspec keyword to declare imported or<br />

exported functions and variables, or to declare Thread Local Storage (TLS) objects.<br />

The __declspec keyword must prefix the declaration specification. For example:<br />

__declspec(noreturn) void overflow(void);<br />

__declspec(thread) int i;<br />

Table 4-2 summarizes the available __declspec attributes. __declspec attributes are<br />

storage class modifiers. They do not affect the type of a function or variable.<br />

Table 4-2 __declspec attributes supported by the compiler and their equivalents<br />

__declspec attribute<br />

non __declspec equivalent<br />

__declspec(dllexport) -<br />

__declspec(dllimport) -<br />

__declspec(noinline)<br />

__declspec(noreturn)<br />

__attribute__((noinline))<br />

__attribute__((noreturn))<br />

__declspec(nothrow) -<br />

__declspec(notshared) -<br />

__declspec(thread) -<br />

4.2.1 __declspec(dllexport)<br />

The __declspec(dllexport) attribute exports the definition of a symbol through the<br />

dynamic symbol table when building DLL libraries.<br />

Usage<br />

When an inline function is marked __declspec(dllexport), the function definition might<br />

be inlined, but an out-of-line instance of the function is always generated, and exported,<br />

in the same way as for a non-inline function.<br />

See also<br />

• __declspec(dllimport) on page 4-25.<br />

4-24 Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348A<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!