Share via


iwcall (Windows Embedded CE 6.0)

1/5/2010

The iwcall declspec allows the programmer to select which function calls are interworking, regardless of whether the ARM or THUMB compiler is used.

Using iwcall allows you to avoid link-time generation of interworking thunking routines.

Note that iwcall has no effect unless it is used on a function prototype visible to the caller.

The iwcall declspec does not cause the associated function to have an interworking return. To make an interworking return, use the -/QRinterwork-return - Enable Interworking flag.

You can use __declspec(iwcall) on the prototype of the user-supplied function to enable the library to handle either case.

The following code example shows how to use of iwcall declspec to enable a user-supplied function myfunction().

__declspec(iwcall) int myfunction();
int main()
{
  return myfunction();
}

The following listing shows the code generated from this declspec when compiled with /QRArch - Specify Target Architecture.

  str       lr, [sp, #4]!
  ldr       r3, [pc, #8]
  mov       lr, pc
  bx        r3
  ldmia     sp!, {pc}
  DCD       |myfunction|

The following listing shows the code generated with the ARM compiler using the /QRthumboption.

  push      {lr}
  ldr       r3, [pc, #0x2]
  mov       r12, r3
  bl        __r12_indirect
  pop       {pc}
  DCD       |myfunction|

See Also

Reference

/QRinterwork-return - Enable Interworking
/QRArch - Specify Target Architecture

Concepts

Modifiers