Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0147a9bfce07355f9a8548b8ef70fd75212a0b1a
Ticket: 633990ffffffffffffffffffffffffffffffffff
tcl.h always makes incorrect #define
User & Date: edwardross on 2002-11-05 19:27:37
Changes

  1. assignee changed to: "kennykb"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    PROBLEM
    ---------------
    
    in tcl.h TCL_STORAGE_CLASS is correctly defined arround
    line 249 with the following:
    
    #undef TCL_STORAGE_CLASS
    #ifdef BUILD_tcl
    # define TCL_STORAGE_CLASS DLLEXPORT
    #else
    # ifdef USE_TCL_STUBS
    #  define TCL_STORAGE_CLASS
    # else
    #  define TCL_STORAGE_CLASS DLLIMPORT
    # endif
    #endif
    
    However later in the same file arround line 1691, it is
    incorrectly defined as:
    
    #undef TCL_STORAGE_CLASS
    #define TCL_STORAGE_CLASS
    
    EXTERN intTcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp));
    
    #endif /* RESOURCE_INCLUDED */
    
    #undef TCL_STORAGE_CLASS
    #define TCL_STORAGE_CLASS DLLIMPORT
    
    This usually doesn't cause any problems, but if you
    then try to link with proWrap.h, this incorrect
    definition of TCL_STORAGE_CLASS means that we can't
    link.  Would also be a problem for linking with static
    libs rather than dlls  (obviously talking about on
    windows here).
    
    Workaround
    ------------------
    
    Undefine TCL_STORAGE_CLASS before include proWrap.h.
    
    Possible Resolution
    -----------------------------
    
    (1) change the definition at line 249 to:
    
    #ifdef __cplusplus
    #  define HEAD_EXTERN extern "C"
    #else
    #  define EXTERN extern TCL_STORAGE_CLASS
    #endif
    
    #define EXTERN HEAD_EXTERN TCL_STORAGE_CLASS
    
    (2) Remove all further defines/undefines for
    TCL_STORAGE_CLASS at line 1694 etc.
    
    (3) change the declaration at line 1694 to:
    EXTERN_HEAD int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp
    *interp));
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "edwardross"
  9. subsystem changed to: "40. Dynamic Loading"
  10. title changed to: "tcl.h always makes incorrect #define"
  11. type changed to: "Bug"