Method and system for supporting dual conventions for...

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S152000, C717S152000

Reexamination Certificate

active

06199200

ABSTRACT:

BACKGROUND OF THE INVENTION
1. Technical Field
The present invention relates in general to an improved data processing system and in particular to a method and system for supporting dual calling conventions between different compilers. Still more particularly, the present invention relates to a method and system for supporting dual calling conventions between different compilers for methods that return structures.
2. Description of the Related Art
A “compiler” is a program that translates programs written in a high-level programming language into the native machine language of a data processing system. The input into a compiler is the “source program” or “source code” and the output is called the “object program” or “target code”. Presently, in the DOS/Windows environment, no universally agreed upon calling convention exists for procedures returning structures when source code is compiled into object code. For example, most C or C++ compilers implement one of two systems for returning structures. One involves defining attributes that return pointers to structures and another entails employing a method where the caller provides a hidden argument for passing a structure back to the caller. The first is employed by Microsoft's C and C++ compiler while the second method of returning structures is employed by Borland's compiler for C and C++. Borland C and Borland C++ are available from Borland International, Inc., located in Scotts Valley, Calif. C and C++ compilers are available from Microsoft Corporation located in Redmond, Wash. As a result, between the Borland and Microsoft compilers, no binary standard exists for procedures returning structures.
For products featuring binary class libraries or binary procedure libraries, this lack of standardization can become a severe problem. Some software vendors avoid this problem by excluding methods or procedures returning structures. However, in order to facilitate the construction and distribution of language-independent class libraries that can be distributed in binary form, it is sometimes necessary to provide procedures which return structures.
Therefore, it would be advantageous to have a method and system for providing compatibility between different calling conventions found in different compilers for procedures returning structures.
SUMMARY OF THE INVENTION
It is therefore one object of the present invention to provide an improved data processing system.
It is another object of the present invention to provide a method and system for supporting dual calling conventions between different compilers.
It is yet another object of the present invention to provide a method and system for supporting dual calling conventions between different compilers for methods that return structures.
The foregoing objects are achieved as is now described. According to the present invention, a technique is provided for supporting multiple calling conventions for methods and procedures that return structures. A source code of a client program may be compiled by either of two compiler types, wherein one compiler type employs a calling convention that is different from the other. A binary library containing procedures, and a converter procedure 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 convention 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.
The binary library may be created by inserting one or more macros into the binary library, modifying the signature for the result, and using a compiler following either calling procedure. Compiling the binary library with the macros results in the expansion of the code appropriate for the calling convention employed by the compiler.
The above as well as additional objects, features, and advantages of the present invention will become apparent in the following detailed written description.


REFERENCES:
patent: 4916610 (1990-04-01), Bapat
patent: 5146593 (1992-09-01), Brandle et al.
patent: 5293630 (1994-03-01), Tatge et al.
patent: 5452456 (1995-09-01), Mourey et al.
patent: 5455949 (1995-10-01), Conder et al.
patent: 5469574 (1995-11-01), Chang et al.
patent: 5583988 (1996-12-01), Crank et al.
patent: 5774729 (1998-06-01), Carney et al.
Hayes et al, Facilitating Mixed Language Programming in Distributed Systems, IEEE Trans on Soft Engr. vol. SE-13, No. 12 Dec. 1987.

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Method and system for supporting dual conventions for... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Method and system for supporting dual conventions for..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method and system for supporting dual conventions for... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2522626

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.