Questions about compiling the toolkit with Borland pop up once in a
while, frequently enough to warrant a postion on the FAQ, so here is a
report of an attempt to do so.

It is not a difficult task, some changes to the makefiles and a few
changes to some os dependant files, yunchan.h, env_nt.h, yunchan.c and
env_nt.c.

The biggest change is with the NT compatability functions,
create_tempfile and close_file.

Borland's compiler fell over the reference to _tmpfname. The functions
create_tempfile and close_file apparently assume these to be a member of
the FILE structure. Not in Borlands C-lib, but this one has a simple
flag (istemp) which tells fclose() to unlink the file, after closing.
This one does appear to remove the temporary file.

It is still neccesary to keep the creat_tempfile workaround though, BC's
tmpfile() will also create a file in the current working directory. If
fiddling with the internals of the FILE structure is a bit awkward, a
list with streams opened by create_tempfile could be maintained. Upon
closing a stream, those listed could be removed (after closing).

Compilation also failed on a define relating to the sleep function,
removing the #define for sleep removed the problem, Borland has a
sleep(seconds) function.

getpid() is available, removed the define in env_nt.h.

imap4r1.c has 'unreachable code at lines 3013-3039. Has nothing to do
with the compiler, I think.

random() is random(num) in BC-lib: #define random rand

A number of standard C-lib symbols were referenced by their underscored
name, such as _stricmp. I edited these to their regular names. Was there
a specific reason to use these versions? Or was it just a name-mangling
thing for the linker?

Well, that is it, or most of it. Lots of warnings about 'suspicious
pointer conversions', prototypes, that sort of stuff. But the library,
mtest and mailutil compiled and seem to work as expected. I haven't
touched the imapd and popd servers yet. Is there a more thorough
'testbed' for the c-client lib, the tools and the pop and imap daemons?

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

Reply via email to