发明授权
- 专利标题: Method and system for supporting dual conventions for methods that return structures
- 专利标题(中): 支持返回结构的方法的双重约定的方法和系统
-
申请号: US08228329申请日: 1994-04-15
-
公开(公告)号: US06199200B1公开(公告)日: 2001-03-06
- 发明人: Liane Elizabeth Haynes Acker , Larry Keith Raper
- 申请人: Liane Elizabeth Haynes Acker , Larry Keith Raper
- 主分类号: G06F900
- IPC分类号: G06F900
摘要:
A technique for providing support for multiple calling conventions for methods and procedures that return structures is provided. A source code of a client program may be compiled by either of two compilers, wherein one compiler employs a calling convention that is different from the first one. A binary library containing a procedure and a converter for each procedure returning a structure to a client program, is provided to support two calling conventions. If the client program is compiled by a compiler using a first calling convention, the program is compiled such that it calls the procedure directly and receives a result, a structure, via the first calling convention. Compiling the client program with a compiler using the second conventions results in calls to the procedure being routed to the converter, which calls the associated procedure, using the first calling convention. The converter receives the result from the procedure and returns the result to the client program using the second calling convention. A special modification to the signature of the procedure as it appears in the library source code, combined with the use of macros to generate a companion converter, permit a binary library to be built by a single compiler, such that the library supports the calling conventions for returning structures appropriate to two different compilers.
信息查询