Skip to content
Tcl Source Code History Of Ticket 442178ffffffffff
Login

History Of Ticket 442178ffffffffff

Artifacts Associated With Ticket 442178ffffffffff

  1. Ticket change [c3edf2e904] (rid 111758) by mdejong on 2001-07-17 22:11:51:

    1. assignee initialized to: "davygrvy"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      This patch should fix the last of the Cygwin
      include errors. I wanted to have David Gravereaux
      take a look at this since he has worked in
      this code before.
      
      The problem is that Cygwin does not have a <tchar.h>
      file. The TCHAR type is defined in <winnt.h> but
      you need to pull in <windows.h> to get at it.
      
      Does this seem ok? I took out the bit that
      checks for _INC_TCHAR because that should not
      be needed and it is MSVC specific. I also
      made it depend on _MSC_VER instead of __WIN32__
      since Cygwin, Mingw, and VC++ each define
      __WIN32__.
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "7 High"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "mdejong"
    9. subsystem initialized to: "52. Portability Support"
    10. title initialized to: "Cygwin TCHAR in tclPlatDecls.h fix"
    11. type initialized to: "Patch"
  2. Ticket change [b33458af10] (rid 98483) by mdejong on 2001-07-18 05:11:52:

    1. icomment:
      
      
      File Added - 8538: patch
      
      
      
    2. login: "mdejong"
    3. mimetype: "text/plain"
    4. username: "mdejong"
  3. Add attachment "patch" [5f2d3dc671] (rid 115769) by mdejong on 2001-07-18 05:11:52.

  4. Ticket change [9ba1d18b13] (rid 111162) by davygrvy on 2001-07-18 07:24:53:

    1. icomment:
      
      
      File Added - 8544: patch2.txt
      
      Logged In: YES 
      user_id=7549
      
      yeah, I see where you're going with this.  Lets not forget 
      borland, too.
      
      How does this look?
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  5. Ticket change [0cb0d8520c] (rid 114225) by davygrvy on 2001-07-18 07:28:03:

    1. icomment:
      
      
      File Added - 8545: patch3.txt
      
      Logged In: YES 
      user_id=7549
      
      whoop.. forgot a closing #endif.
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  6. Add attachment "patch3.txt" [3d225c721b] (rid 121035) by davygrvy on 2001-07-18 07:28:03.

  7. Ticket change [996d51892e] (rid 110792) by davygrvy on 2001-07-18 07:28:50:

    1. icomment:
      
      
      File Deleted - 8544: 
      
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  8. Ticket change [d7a3e4d980] (rid 124026) by mdejong on 2001-07-18 07:43:52:

    1. icomment:
      Logged In: YES 
      user_id=90858
      
      I looked at the patch, but I still don't understand what
      that "elif !defined(_INC_TCHAR)" bit is for. The MSVC
      include file checks to see if _INC_TCHAR is defined
      so there is no danger of including tchar.h twice:
      
      % cat t3.c
      #include <tchar.h>
      #include <tchar.h>
      
      int main() {}
      
      % cl -c t3.c
      
      What is up with that?
      
      Why not just do this:
      
      #if defined(__WIN32__)
      #   if defined(__CYGWIN__)
      #     define WIN32_LEAN_AND_MEAN
      #     include <windows.h>
      #     undef  WIN32_LEAN_AND_MEAN
      #   else
      #     include <tchar.h>
      #   endif
      #endif
      
      Or, if it does not matter, could we just do this?
      
      #ifdef __WIN32__
      #  define WIN32_LEAN_AND_MEAN
      #  include <windows.h>
      #  undef  WIN32_LEAN_AND_MEAN
      #endif
      
      
      
    2. login: "mdejong"
    3. mimetype: "text/plain"
    4. username: "mdejong"
  9. Ticket change [0ebd51a46e] (rid 94669) by davygrvy on 2001-07-18 08:51:35:

    1. icomment:
      Logged In: YES 
      user_id=7549
      
      Oh.  tchar.h isn't in the platform SDK.  I understand.
      
      #if defined(__WIN32__) && !define(_TCHAR_DEFINED)
      #   define WIN32_LEAN_AND_MEAN
      #   include <windows.h>
      #   undef  WIN32_LEAN_AND_MEAN
      #endif
      
      What would be nicer, might be the expansion of TCHAR 
      instead.  This is the external API and TCHAR has different 
      meanings with _UNICODE and _MCBS defined.
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  10. Ticket change [3cfc01259f] (rid 121009) by mdejong on 2001-07-18 13:27:02:

    1. icomment:
      Logged In: YES 
      user_id=90858
      
      Humm, that is an interesting point.
      
      If you look at the top of the tclWinPort.h
      file, you will find the following:
      
      #ifndef _TCLINT
      #   include "tclInt.h"
      #endif
      
      #ifdef CHECK_UNICODE_CALLS
      
      #define _UNICODE
      #define UNICODE
      
      #define __TCHAR_DEFINED
      typedef float *_TCHAR;
      
      #define _TCHAR_DEFINED
      typedef float *TCHAR;
      
      #endif
      
      I was under the impression that defining
      _UNICODE and then pulling in <windows.h>
      would define TCHAR as wchar_t. It seems
      odd that it is already typedefed as a
      float* here. Any idea what is going on
      there? If we pull in <windows.h> in tclPlatDecls.h
      then it will not be defined the same way as
      in tclWinPort.h because _UNICODE is not defined.
      
      Also, it seems like <windows.h> is getting
      pulled in multiple times, even when it is
      not needed. For example, removing this
      include seems fine since  <tclPort.h>
      already pulls <tclWinPort.h> which includes
      <windows.h>. There is also one in tclAppInit.c,
      but I am not sure about that on.
      
      
      diff -u -r1.12 tclWinReg.c
      --- win/tclWinReg.c     2000/06/13 20:30:24     1.12
      +++ win/tclWinReg.c     2001/07/18 06:20:08
      @@ -17,10 +17,6 @@
       #include <tclPort.h>
       #include <stdlib.h>
       
      -#define WIN32_LEAN_AND_MEAN
      -#include <windows.h>
      -#undef WIN32_LEAN_AND_MEAN
      -
      
      
      
    2. login: "mdejong"
    3. mimetype: "text/plain"
    4. username: "mdejong"
  11. Ticket change [1f88a2cb3c] (rid 91162) by mdejong on 2001-07-18 15:22:13:

    1. icomment:
      Logged In: YES 
      user_id=90858
      
      Ok, I took another look at things and I think
      one of these two options is the ticket.
      
      The first option is to pull <windows.h> into
      tclPlatDecls.h. This moves the currently unused
      TCHAR defines in the CHECK_UNICODE_DEFINES block.
      
      Index: generic/tclPlatDecls.h
      ===================================================================
      RCS file: /cvsroot/tcl/tcl/generic/tclPlatDecls.h,v
      retrieving revision 1.6
      diff -u -r1.6 tclPlatDecls.h
      --- generic/tclPlatDecls.h2000/08/20 03:51:231.6
      +++ generic/tclPlatDecls.h2001/07/18 08:04:32
      @@ -13,13 +13,29 @@
       #define _TCLPLATDECLS
       
       /*
      - *  Pull in the definition of TCHAR.  Hopefully the compile
      flags
      - *  of the core are matching against your project build for
      these
      - *  public functions.  BE AWARE.
      + *  Define TCHAR by pulling in <windows.h>. If the
      + *  core uses unicode but an extension does not, a compile
      + *  time error should be generated. BE AWARE.
        */
      -#if defined(__WIN32__) && !defined(_INC_TCHAR)
      -#include <tchar.h>
      -#endif
      +#ifdef __WIN32__
      +
      +#ifdef CHECK_UNICODE_CALLS
      +
      +#define _UNICODE
      +#define UNICODE
      +
      +#define __TCHAR_DEFINED
      +typedef float *_TCHAR;
      +
      +#define _TCHAR_DEFINED
      +typedef float *TCHAR;
      +
      +#endif /* CHECK_UNICODE_CALLS */
      +
      +# define WIN32_LEAN_AND_MEAN
      +# include <windows.h>
      +# undef WIN32_LEAN_AND_MEAN
      +#endif /* __WIN32__ */
       
       /* !BEGIN!: Do not edit below this line. */
       
      Index: win/tclWinPort.h
      ===================================================================
      RCS file: /cvsroot/tcl/tcl/win/tclWinPort.h,v
      retrieving revision 1.16
      diff -u -r1.16 tclWinPort.h
      --- win/tclWinPort.h2001/07/17 18:33:241.16
      +++ win/tclWinPort.h2001/07/18 08:04:32
      @@ -20,19 +20,6 @@
       #   include "tclInt.h"
       #endif
       
      -#ifdef CHECK_UNICODE_CALLS
      -
      -#define _UNICODE
      -#define UNICODE
      -
      -#define __TCHAR_DEFINED
      -typedef float *_TCHAR;
      -
      -#define _TCHAR_DEFINED
      -typedef float *TCHAR;
      -
      -#endif
      -
       /*
       
      *---------------------------------------------------------------------------
        * The following sets of #includes and #ifdefs are required
      to get Tcl to
      @@ -66,10 +53,6 @@
       #include <time.h>
       #include <winsock.h>
       
      -#define WIN32_LEAN_AND_MEAN
      -#include <windows.h>
      -#undef WIN32_LEAN_AND_MEAN
      -
       #ifdef BUILD_tcl
       # undef TCL_STORAGE_CLASS
       # define TCL_STORAGE_CLASS DLLEXPORT
      
      
      The second option would be to leave the
      #include <windows.h> in tclWinPort.h and
      just #define TCHAR for ourselves in
      tclPlatDecls.h.
      
      Index: generic/tclPlatDecls.h
      ===================================================================
      RCS file: /cvsroot/tcl/tcl/generic/tclPlatDecls.h,v
      retrieving revision 1.6
      diff -u -r1.6 tclPlatDecls.h
      --- generic/tclPlatDecls.h2000/08/20 03:51:231.6
      +++ generic/tclPlatDecls.h2001/07/18 07:50:42
      @@ -13,13 +13,17 @@
       #define _TCLPLATDECLS
       
       /*
      - *  Pull in the definition of TCHAR.  Hopefully the compile
      flags
      - *  of the core are matching against your project build for
      these
      - *  public functions.  BE AWARE.
      + *  Define TCHAR without pulling in <windows.h>. If the
      + *  core uses unicode but an extension does not, a compile
      + *  time error should be generated. BE AWARE.
        */
      -#if defined(__WIN32__) && !defined(_INC_TCHAR)
      -#include <tchar.h>
      -#endif
      +#ifdef __WIN32__
      +#ifdef UNICODE
      +#define TCHAR wchar_t
      +#else
      +#define TCHAR char
      +#endif /* UNICODE */
      +#endif /* __WIN32__ */
       
       /* !BEGIN!: Do not edit below this line. */
       
      @@ -96,6 +100,10 @@
       #ifdef __cplusplus
       }
       #endif
      +
      +#ifdef __WIN32__
      +#undef TCHAR
      +#endif /* __WIN32__ */
       
       #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
       
      
      Comments? Does one seem better than the other?
      
      
    2. login: "mdejong"
    3. mimetype: "text/plain"
    4. username: "mdejong"
  12. Ticket change [ddbd9a414f] (rid 114725) by hobbs on 2001-07-19 11:57:33:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      These are only includes we are talking about, so I'm not so 
      sure that we should be using these verbose #define checks 
      instead of just including what we know works in the end 
      (like windows.h).  Checking on things like _INC_TCHAR seems 
      like an unnecessarily fragile thing to do.
      
      Also, we should keep the patches to the upload bit, because 
      the comment area doesn't maintain plain text formatting.
      
      I'm for whatever it guaranteed to be correct for VC++ and 
      cygwin without unneeded complexity in #def checks.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  13. Ticket change [ba619e488d] (rid 129317) by mdejong on 2001-07-19 14:04:31:

    1. closedate changed to: "2001-07-19T07:04:31"
    2. closer changed to: "mdejong"
    3. icomment:
      Logged In: YES 
      user_id=90858
      
      Ok, I went ahead and checked in the version that
      pulled in <windows.h> in tclPlatDecls.h. Things
      now compile with VC++, mingw, and cygwin (minus
      the CreateThread changes).
      
      
    4. login: "mdejong"
    5. mimetype: "text/plain"
    6. resolution changed to: "Accepted"
    7. status changed to: "Closed"
    8. username: "mdejong"