On Sat, 05 Dec 2009, Tamas TEVESZ wrote: Hi,
> contrib/hbtpathy/tpunix.c: > 270 HB_FUNC( __TP_CTRLCTS ) > 271 { > 272 #if !defined( CRTSCTS ) && defined( __WATCOMC__ ) > 273 # define CRTSCTS 020000000000 > 274 #endif > is there a reason for the "&& defined( __WATCOMC__ )" part? i've just > found another platform where CRTSCTS isn't defined, and am wondering > whether anyone has anything against, or a better idea instead of, just > dropping the watcom constraint from this conditional. I intentionally reduce above define to __WATCOMC__ builds because only for Linux open Watcom builds I verified that the valid value is 020000000000. I should even change the condition to use: defined( __WATCOMC__ ) && defined( HB_OS_LINUX ) In fact I should make it also in few other places to avoid potential problems with OpenWatcom builds for other *nixes. CRTSCTS not commonly used constant value defined by some standards like 0, 1, 2 for stdin, stdout and stderr handlers which we can safely use without any macros on POSIX systems. It strictly depends on CRTL and used system. If compiler does not redefine this macro value using its own CRTL wrapper to system call then on Linux and SunOS it's 0x80000000 but in OpenBSD and NetBSD it's 0x00010000, in FreeBSD it's 0x0003000, in HAIKU it's 0x6000, DJGPP uses it's own non system code for termios with flags incompatible with any other system and it does not CRTSCTS at least explicitly, etc. I think that this define can be enabled for other C compilers on given system (the same C compiler may use different constant values on different systems) only after verification the valid value for this macro is used. Otherwise we may only silently hide real problem. If we introduce such hacks in too many places then porting Harbour to new OS or finding some bugs will be nightmare. Viktor, I've seen you committed above modification but I would like to ask you to remove it and enable such definition only for compilers and system where you verified exact working value. If in some systems such functionality is available but CRTL does not give interface to it then we can disable some part of code during compilation and introduce 'int TODO;' dummy variable to generate warning which will mark that some things should be updated. best regards, Przemek _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour