Menu

#94 TIP#60 patch

closed-out-of-date
5
2008-11-29
2001-06-25
Anonymous
No

With the material submiited here it is possible to build Tcl 8.3.3 with the current
Borland compiler.
IMHO there are two points where someone more knowledgable than me should have
a look:
1) The typedef for ClientData
The original version did a test

# if defined(__STDC__) || defined(__cplusplus)

when defining the typedef ClientData, which does not work well for the Borland compiler:
- __cplusplus is not defined (or else the regexp-package will not compile)
- __STDC__ is only #defined if you set '-A' for strict ANSI compatibility. But then the
compiler is *really* strict and thus quite a few files will not compile for various reasons
(e.g. a '//' comment in one of the Windows header files).

So you're stuck with 'typedef int *ClientData;' - which in turn forces an ugly type cast
in the function 'Tcl_CreateThread' for the parameter 'proc' in the call to
_beginthreadex (file tclWinThrd.c).

But then I wondered: Are we asking the appropriate question? We ask:
Is it a (strict?) ANSI or a C++ compiler?
when all we want to know is whether it supports the 'void' key word or not. Hence
the #define KNOWS_VOID in tcl.h.

2) Borland #defines more error codes in <errno.h> than does VC++. This leads to a
clash in error definitions in tclWinPort.h when EDQUOT is #defined as 49, because
the last #define in Borland's errno.h is
#define ENOTEMPTY 49 /* Directory not empty */
With these two definitions tclPosixStr.c will not compile.
I changed the #define for EDQUOT to 69 because in some other header file I found the
same definition to achieve compilation.
However there might well be better choices.

I hope that this description makes sense and that the attached diff file is what you need.
Best regards
Helmut Giese

Discussion

  • Andreas Kupries

    Andreas Kupries - 2001-08-24
    • assigned_to: nobody --> davygrvy
     
  • David Gravereaux

    Logged In: YES
    user_id=7549

    I guess I got assigned to this, eh?

    Ok, I got the "free commandline tools" here. I'll look
    into it.

     
  • Don Porter

    Don Porter - 2001-09-06

    Logged In: YES
    user_id=80530

    I'm guessing that this report is related to the changes
    checked in to generic/tclPlatDecls.h on Sept-05-2001.

    Note that those changes will be overwritten the next time
    someone does 'make genstubs'. The script tools/genStubs.tcl
    needs to be updated to generate the changed *.h file(s).

     
  • David Gravereaux

    Logged In: YES
    user_id=7549

    Hi Don,

    Not actually true. 1.10 was a mistake, but 1.11 a few
    minutes later has the changes above the marker:

    /* !BEGIN!: Do not edit below this line. */

     
  • David Gravereaux

    Logged In: YES
    user_id=7549

    I'm starting to put together a TIP about changing the
    EXTERN macro. Borland will need some partially ugly fixes
    put into tcl.h and genStubs.tcl.

     
  • David Gravereaux

    Logged In: YES
    user_id=7549

    as of <now>, everything is in except for the new
    makefile.bc and the errno stuff. I want to do a TIP
    regarding changing the EXTERN macro. For example, what is
    this for MSvc++:

    __declspec(dllexport) __cdecl int func (int a, int b);

    needs to be this with borland:

    int __cdecl __export func (int a, int b);

    The order of the attribute needs to be after the return
    type. Watch for a TIP soon.

    note to self: not sure what to do about the errno stuff
    yet...

     
  • David Gravereaux

    Logged In: YES
    user_id=7549

    Here's a new patch for what I think the EXTERN macro should
    do.

     
  • David Gravereaux

    Logged In: YES
    user_id=7549

    I like this proposed patch better. More complete..

     
  • David Gravereaux

    Logged In: YES
    user_id=7549

    wheee!

    makefile.bc commited. Looking good. Not perfect yet. All
    changes in this patch report were commited to the HEAD not
    to the core-8-3-1-branch.

    Time to get the TIP ready...

     
  • David Gravereaux

    • status: open --> open-accepted
     
  • David Gravereaux

    Logged In: YES
    user_id=7549

    TIP inserted into system and newer patch file ready to go.

     
  • Mo DeJong

    Mo DeJong - 2001-09-07

    Logged In: YES
    user_id=90858

    I have to admit, I don't think it is a good idea to
    add a new makefile.bc file. Why can't Borland support
    be added using the ./configure and Makefile.in build
    system? There has been quite a bit of work done to
    get things working with VC++ and gcc under Windows.
    Adding a new Makefile will just lead to more duplicated
    work down the road.

     
  • David Gravereaux

    Logged In: YES
    user_id=7549

    The maintainence utility that goes with Borland is called
    make.exe. It's a Borland product. It's installed with the
    archive refered to as "free commandline tools".

    'nuff said.

    If later on, we want to abstract a common denominator to a
    makefile.win, then launching either nmake.exe, make.exe, or
    wmake.exe with appropriate rules, we can. I know you think
    the whole world should run GNU tools, but guess what?...

    **** They aren't included with all IDE/dev products. *****

    I mentioned makefile.bc in your TEA v2.0 TIP, and you got
    all worried. Well, here it is. go make some autoconf
    rules with it.

    PS. wmake.exe referes to Watcom, which I'm working on as I
    type this.

     
  • David Gravereaux

    • status: open-accepted --> closed-accepted
     
  • David Gravereaux

    Logged In: YES
    user_id=7549

    I'll call this closed. The TIP is dead, but doesn't matter bcc32 5.5+, only the older ones.

     
  • David Gravereaux

    • status: closed-accepted --> open-remind
     
  • David Gravereaux

    scary EXTERN macro change (take #4)

     
  • David Gravereaux

    scary EXTERN macro change (take #5)

     
  • David Gravereaux

    scary EXTERN macro change (take #6) for 8.5a2

     
  • David Gravereaux

    • summary: Support for Borland compiler f Tcl 8.3.3 --> TIP#60 patch
    • status: open-remind --> open
     
  • Donal K. Fellows

    • status: open --> closed-out-of-date
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.