delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/06/13:25:31

Sender: edevaldo AT pobox2 DOT mot DOT com
Message-ID: <37823C63.64744AF9@motorola.com>
Date: Tue, 06 Jul 1999 14:26:59 -0300
From: Edevaldo Pereira da Silva Junior <Edevaldo DOT Pereira AT motorola DOT com>
Organization: Motorola - Semiconductor Producrs Sector
X-Mailer: Mozilla 4.07 [en] (X11; I; SunOS 5.5.1 sun4u)
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp AT delorie DOT com
Subject: Re: TCL Port
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990704163233 DOT 13333e AT is>
X-Motorola-Sent-Wireless: 1
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> Yes, the backslash is there because these commands are appended (see
> the a\ in the first line of the block).  I think the problem is that
> the last line of the block ends with a backslash:
> 
>    s,Makefile\\.am\\.in,Makefile.am-in,g\
> 
> Please remove the traling backslash and see if that solves the
> problem.
> 

	Yes! The script works fine now. And it took out a lot of warnings too.
	Now, with some tricks, everything is compiling (and working) but there
are some other issues where I need some help. Most of then has to do
with the DJGPP library implementation.


	The first one has to do with the time_t type declaration in the time.h
header file. If I'm not wrong DJGPP declares it as unsigned but the TCL
sources expect it to be a signed. TCL uses time_t to do date and time
math. There are constants like "yesterday" that is a negative number.
	I'm not sure if this will break the TCL code, but some date comparison
may have problems. Also, I'm not sure if it is a TCL or DJGPPlib problem
but my sun machine declares timer_t as a long. Comments?

	Another problem has to do with math.h. The configure script tests
math.h to see if DOMAIN and SIGN macros are declared, there is a
"ifdefined" struct called exception that is declared if DOMAIN and SIGN
does not exist inside math.h (DOMAIN and SIGN are also defined if
needed).
	The problem is that DOMAIN and SIGN exists inside DJGPP but they are
inside ./libm/math.h that replaces math.h if _DJGPP_USE_LIBM (or
something similar) is declared.
	To solve this I would have to modify the test in the configure script
to detect and use the correct libm and then patch the sources to define
_DJGPP_USE_LIBM. Not too difficult, but all modifications that I did
(until now) to the sources of TCL were inside a file called TCLPort.h.
This file is intended to change across platforms and is the only file
that have ifdefs for platform specific issues. It would be nice to keep
all the changes inside this single file but it is not possible in this
case because math.h is included before TCLPort.h. Is there any mean to
define _DJGPP_USE_LIBM(or something similar ;)) in the makefile or the
configure script? Globally?

	The last one (for now) is something that I have been ignoring for years
and I always wanted to ask about. It's about using %d with longs in
printf. Does %d only work for 16 bits? What is right in this case? %ld?
	The documentation seems to be confusing in this subject (I didn't look
in the DJGPP info yet). Frequently is says that %d & %i are used for
signed ints. But in our case signed ints are 32 bits, but the compiler
generates a warning either way. %D don't work as well.

	Thanks,

					Edevaldo

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019