Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7bef42d0397b8f4c30dfcd266a277ae275ebee60
Ticket: 219174ffffffffffffffffffffffffffffffffff
Tcl_InitStubs() not usable in tcl81.dll
User & Date: nobody on 2000-10-26 05:02:50
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1841 Bug
    Version: 8.1b3
    SubmitDate: '1999-04-15'
    LastModified: '1999-04-21'
    Severity: LOW
    Status: Assigned
    Submitter: pat
    ChangedBy: redman
    RelatedBugIDs: 1842
    OS: Windows NT
    OSVersion: 4.0 SP3
    Machine: X86
    FixedDate: '2000-10-25'
    ClosedDate: '2000-10-25'
    
    
    Name:
    
    Jan Nijtmans
    
    
    
    Comments:
    
    The supplied patch does 3 things:
    
        - Change the TCL_STORAGE_CLASS of Tcl_InitStubs to be empty,
    
          in exactly the same was as for Tcl_AppInit(). This prevents
    
          the Tcl_InitStubs function to be exported from tcl81.dll
    
        - Remove the Tcl_InitStubs() call from tclBasic.c (Windows only)
    
        - Remove tclStubLib.obj from the object list.
    
        The result of this is that tcl81.dll is somewhat smaller, and
    
        doesn't export Tcl_InitStubs() any more.
    
    
    
    ReproducibleScript:
    
    Build an extension with -DUSE_TCL_STUBS, and link it with tcl81.lib.
    
        This results in a few unresolved symbols, because on Windows
    
        global variables cannot be exported (without hacking the def-file)
    
    
    
    ObservedBehavior:
    
    Although this is really a bug in Windows, exporting the function
    
        Tcl_StubInit() suggests that linking against the lib-file works.
    
        Therefore I suggest to remove the Tcl_StubInit() function from
    
        tcl81.dll: it doesn't serve any function, except confusing some
    
        users why it is there anyway.
    
    
    
    Patch:
    
    *** generic/tcl.h.origWed Apr 14 22:17:41 1999
    
    --- generic/tcl.hWed Apr 14 22:21:10 1999
    
    ***************
    
    *** 1465,1493 ****
    
      #define TCL_STUB_MAGIC 0xFCA3BACF
    
      
    
      /*
    
    -  * The following function is required to be defined in all stubs aware
    
    -  * extensions.  The function is actually implemented in the stub
    
    -  * library, not the main Tcl library, although there is a trivial
    
    -  * implementation in the main library in case an extension is statically
    
    -  * linked into an application.
    
    -  */
    
    - 
    
    - EXTERN char *Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp,
    
    -     char *version, int exact));
    
    - 
    
    - #ifndef USE_TCL_STUBS
    
    - 
    
    - /*
    
    -  * When not using stubs, make it a macro.
    
    -  */
    
    - 
    
    - #define Tcl_InitStubs(interp, version, exact) \
    
    -     Tcl_PkgRequire(interp, "Tcl", version, exact)
    
    - 
    
    - #endif
    
    - 
    
    - 
    
    - /*
    
       * Include the public function declarations that are accessible via
    
       * the stubs table.
    
       */
    
    --- 1465,1470 ----
    
    ***************
    
    *** 1511,1516 ****
    
    --- 1488,1506 ----
    
      #define TCL_STORAGE_CLASS
    
      
    
      EXTERN intTcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp));
    
    + EXTERN char *Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp,
    
    +     char *version, int exact));
    
    + 
    
    + #ifndef USE_TCL_STUBS
    
    + 
    
    + /*
    
    +  * When not using stubs, make it a macro.
    
    +  */
    
    + 
    
    + #define Tcl_InitStubs(interp, version, exact) \
    
    +     Tcl_PkgRequire(interp, "Tcl", version, exact)
    
    + 
    
    + #endif
    
      
    
      #endif /* RESOURCE_INCLUDED */
    
      
    
    *** generic/tclBasic.c.origWed Apr 14 22:15:47 1999
    
    --- generic/tclBasic.cWed Apr 14 22:17:30 1999
    
    ***************
    
    *** 539,549 ****
    
           */
    
      
    
          Tcl_PkgProvideEx(interp, "Tcl", TCL_VERSION, (ClientData) &tclStubs);
    
    !     
    
      #ifdef Tcl_InitStubs
    
      #undef Tcl_InitStubs
    
      #endif
    
          Tcl_InitStubs(interp, TCL_VERSION, 1);
    
      
    
          return interp;
    
      }
    
    --- 539,551 ----
    
           */
    
      
    
          Tcl_PkgProvideEx(interp, "Tcl", TCL_VERSION, (ClientData) &tclStubs);
    
    ! 
    
    ! #ifndef __WIN32__    
    
      #ifdef Tcl_InitStubs
    
      #undef Tcl_InitStubs
    
      #endif
    
          Tcl_InitStubs(interp, TCL_VERSION, 1);
    
    + #endif
    
      
    
          return interp;
    
      }
    
    *** win/makefile.vc.origWed Apr 14 22:21:20 1999
    
    --- win/makefile.vcWed Apr 14 22:22:47 1999
    
    ***************
    
    *** 183,189 ****
    
      $(TMPDIR)\tclScan.obj \
    
      $(TMPDIR)\tclStringObj.obj \
    
      $(TMPDIR)\tclStubInit.obj \
    
    - $(TMPDIR)\tclStubLib.obj \
    
      $(TMPDIR)\tclThread.obj \
    
      $(TMPDIR)\tclTimer.obj \
    
      $(TMPDIR)\tclUtf.obj \
    
    --- 183,188 ----
    
    
    
    PatchFiles:
    
    tcl.h tclBasic.c makefile.vc
    
    
    
    
    
    4/22/99 - redman - After talking with Scott S., we're going to try another scheme to work around the problem described (exporting the symbols in question and removing the need to use -DUSE_TCL_STUBS).  This really isn't a critical issue and can wait.
    
    
    
  4. foundin changed to: "obsolete: 8.1b3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "Tcl_InitStubs() not usable in tcl81.dll"
  11. type changed to: "Bug"