| delorie.com/archives/browse.cgi | search |
| From: | peter AT agnes DOT dida DOT physik DOT uni-essen DOT de (Peter Gerwinski) |
| Newsgroups: | comp.lang.pascal.misc,comp.os.msdos.djgpp |
| Subject: | Re: A couple quick questions invloving GNU Pascal: Books, Accessing memory and Ports |
| Followup-To: | comp.lang.pascal.misc,comp.os.msdos.djgpp |
| Date: | 12 Jan 1997 11:39:25 GMT |
| Organization: | Universitaet Essen, Germany |
| Lines: | 55 |
| Message-ID: | <5baihd$3v9@sun3.uni-essen.de> |
| References: | <5as7s9$8m AT acs1 DOT star DOT net> <32D2F879 DOT 4209 AT cam DOT org> |
| Reply-To: | peter DOT gerwinski AT uni-essen DOT de |
| NNTP-Posting-Host: | agnes.dida.physik.uni-essen.de |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
> program foo;
> uses crt; <---legal in TP & BP ;GNU ???
Parts of CRT are ported in a library `BO5'. Check the
`contrib' subdirectory of the GNU Pascal distribution at
ftp://kampi.hut.fi/jtv/gnu-pascal/. From the BO5 file
`djgpp.icl' you can also learn about direct memory access etc.
It should not be too difficult to write a CRT Unit for
GNU Pascal using the stuff already in BO5. Any volunteer
out there?
> and another thingy: TP & BP don't make OBJ's,the linking is automatic.Is
> this a feature of Pascal or just the borland products?
It is a *mis*feature of Borland Pascal that it cannot produce `.obj'
files and thus you cannot access functions written in Borland Pascal,
say, from Borland C. However automatic linking *is* a feature of
Borland Pascal; use the commmand-line option `--automake' to get this
with GNU Pascal.
> Can I link GNU Pascal code in GCC progs?
Yes. Just take care of the Capitalization Of The First Letter In
Each External Pascal Identifier. E.g., if you have a Unit
Unit Foo;
Interface
Function FooBar ( Var Bar: Integer ): Boolean;
Implementation
(* ... ! *)
end.
then you can use the Function `FooBar' from C using the following
header `foo.h':
#define BOOLEAN char
extern BOOLEAN Foobar ( int *bar );
Note that this does not only work on DOS (with DJGPP or EMX) but
on *any* platform supported by GNU Pascal.
Hope this helps,
Peter
e-mail: peter DOT gerwinski AT uni-essen DOT de
home address: D\"usseldorfer Str. 35, 45145 Essen, Germany
WWW: http://agnes.dida.physik.uni-essen.de/~peter/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |