/osf switch

The /osf switch forces strict compatibility with OSF DCE.

midl /osf

Switch Options

This switch has no parameters.

Remarks

Use this switch if your application requires strict compatibility with OSF DCE for portability reasons.

In /osf mode, the RpcSs package is automatically enabled when you use full pointers, the arguments require memory allocation, or when you use the enable_allocate attribute. This means that you do not have to supply the midl_user_allocate and midl_user_free functions in your client and server application.

The following Microsoft-extended features are not available when you compile with the /osf switch:

  • Abstract declarators (unnamed parameters) in the IDL file.
  • Interface definitions for COM objects.
  • Interface names with more than 17 characters.
  • MIDL-only attributes, such as wire_marshal, user_marshal, and the typelib (ODL)extensions.
  • Using ACF keywords in an IDL file (the MIDL /app_config option).
  • Static callback functions on the client.
  • The async attribute.
  • cpp_quote and #pragma midl_echo.
  • wchar_t wide-character types, constants, and strings.
  • enum initialization (sparse enumerators).
  • out-only size specification.
  • Mixed sized-pointers and sized arrays.
  • Expressions used for size and discriminator specifiers.
  • Explicit handle parameters in any position in the argument list. In /osf mode, the MIDL compiler looks for an explicit binding handle as the first parameter. When the first parameter is not a binding handle and one or more context handles are specified, the leftmost context handle is used as the binding handle. When the first parameter is not a handle and there are no context handles, the procedure uses implicit binding using the ACF attribute implicit_handle or auto_handle.
  • Pointer-attribute type inheritance. OSF DCE does not allow unattributed pointers. Therefore, in /osf mode each IDL file must define attributes for its pointers. If any pointer does not have an explicit attribute, the IDL file must have a pointer_default specification to set the pointer type.
  • Multiple interfaces in an IDL file.
  • Definitions outside of the interface block.
  • Type qualifiers such as far and stdcall.
  • Omitting directional attributes.

The following C/C++ language extensions are not available when you compile with the /osf switch:

  • Bit fields in structures and unions.
  • Single line comments delimited with two slash characters (//).
  • External declarations.
  • Procedures with ellipses in the parameter list.
  • Type int.
  • Type void * (except with the context_handle attribute).
  • Type qualifiers, including the form with the ANSI-conformant prefix, contain two underscore characters: __cdecl, cdecl, const, const, __export, export, __far, far, __loadds, loadds, __near, near, __pascal, pascal, __stdcall, stdcall, __volatile, and volatile.
  • Any # pragma warning or #pragma comment.
  • Type serialization.
  • The __int3264 data type.
  • The /protocol switch, and ndr64 transfer syntax.

Examples

midl /osf filename.idl

midl /osf /app_config filename.idl

See also

General MIDL Command-line Syntax

/app_config

/ms_ext

Rpcss Memory Management Package