Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!cs.utexas.edu!usc!apple!agate!shelby!portia.stanford.edu!dhinds From: dhinds@portia.Stanford.EDU (David Hinds) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: Using Turbo C with libraries compiled with Microsoft C Message-ID: <1990Jun5.191530.1488@portia.Stanford.EDU> Date: 5 Jun 90 19:15:30 GMT References: <10760@medusa.cs.purdue.edu> <1990Jun4.205834.13661@cbnewsc.att.com> Organization: AIR, Stanford Universit Lines: 28 In article <1990Jun4.205834.13661@cbnewsc.att.com> tjr@cbnewsc.att.com (thomas.j.roberts) writes: >There are several (many ?) differences between Turbo C and Microsoft C. >Some of them are harmless, some will kill your program; some will kill >MS-DOS, some might even trash your disk(s). > >2) TC and MC use different names for the various segments. >3) TC and MC package library routines differently. >4) TC and MC have different requirements for subroutines to preserve > register contents. >5) The TC run-time library screws around with the console hardware > >In short, I strongly advise against trying to mix compilers in the same >program. If you simply cannot afford to buy the other compiler, then >you probably can make it work with the following kludges... > This sounds like an appropriate place to mention some of the benefits of the Topspeed C compiler vs. Microsoft or Turbo C. The topspeed compiler allows you to specify just about anything having to do with calling conventions on the fly - segment names, parameter passing in registers, stack frame layout, inline function expansion, and register preservation. And you can recompile the run-time libraries to use whatever calling conventions you like. So, you can generally use most 3rd party libraries, regardless of what compiler they were generated with, if you know its calling conventions. You just add some compiler directives to the header files. -David Hinds dhinds@popserver.stanford.edu