Mail Archives: djgpp/1996/11/23/15:54:21
Panos Platon Tsapralis wrote:
> While trying to recompile, using DJGPP, a program, that was originally
> written in Borland-C++, along with some data-base & screen management
> libraries, I encountered error messages that indicate that DJGPP lacks
> functions like "ltoa" ( long-to-ascii ), "ultoa" ( unsigned-long-to-ascii
> ), "MK_FP" ( unknown - could not find in the Borland manuals anything about
> this function ), which admittedly are specific to the Borland's
> implementation of C/C++.
Well, MK_FP not only doesn't exist, but is totally pointless in DJGPP.
Borland's compiler is a 16-bit Real mode compiler (well, the one I had
was). DJGPP is a 32-bit Protected mode compiler. The differences are
largely because of this.
MK_FP in Borland C converts a 16bit pointer to a 32bit segment/offset
pair. In DJGPP, the pointers are all 32-bit. You can access up to 4GB
of memory with a pointer, if the memory protection allows it. (in
borland C, it's only 64k of memory that you can access with a pointer)
DJGPP does support a type of "far" pointers, though. Protected mode has
"selectors" in the "segment" registers. If you use a "far" pointer, you
can access memory outside of your regular 4GB area.
ltoa should be replaced by itoa because DJGPP's regular integers are
32-bit, the same size as Borland's long integers.
Anyway, read the FAQ for more/better information.
-- Yamaha / XYZZ
mailto:scriven AT CS DOT ColoState DOT edu
mailto:scriven AT VIS DOT ColoState DOT edu
http://www.vis.colostate.edu/~scriven/
- Raw text -