Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!husc6!endor!siegel From: siegel@endor.harvard.edu (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: C code in a Pascal program Message-ID: <2074@husc6.harvard.edu> Date: 17 Jun 89 15:24:35 GMT References: <13972@dartvax.Dartmouth.EDU> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Distribution: comp.sys.mac.programmer Organization: Symantec/THINK Technologies, Bedford, MA Lines: 32 In article <13972@dartvax.Dartmouth.EDU> boz@eleazar.dartmouth.edu (John Boswell) writes: >Hi. Hi yourself. >are in C. Is there a way I can compile the C functions, and then somehow >link them to my Pascal program when I compile it? In other words, can you If you're using THINK C 3.0 and later, and THINK Pascal 2.0 or later, you can compile your C routines into a library, and add the library to the THINK Pascal project. The C routines must follow these conventions: - They must be declared as "pascal", as in "pascal void foo(a,b)" or "pascal long bar(z)". - They can't use string constants or floating-point literals. If you want access to Pascal global variables, just declare them as "extern" in your C code, and in your Pascal interfaces, put them in the interface-part. --Rich ~~~~~~~~~~~~~~~ Rich Siegel Staff Software Developer Symantec Corporation, Language Products Group Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel I classify myself as a real developer because my desk is hip-deep in assembly-language listings and I spend more than 50% of my time in TMON. ~~~~~~~~~~~~~~~