Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a801948507a78f377bb8a20d2050c6357955dc65
Ticket: 3571241fffffffffffffffffffffffffffffffff
_USE_32BIT_TIME_T wrong for 32bit __MINGW32__
User & Date: earnie on 2012-09-25 22:59:23
Changes

  1. icomment:
    _USE_32BIT_TIME_T was designed as an after thought to resolve a legacy code compatibility issue.  It should only be defined for those applications that require a time_t structure that is 32 bits.  By default, time_t is 64 bits and only 64 bits time_t structure is provided by the default runtime.
    
    So if you define _USE_32BIT_TIME_T in your code you need to provide a library that supports the functions something like -lmsvcr80 but then the user must be aware that msvcr80.dll is required and it might not be since it isn't supplied by default.
    
    The changes I've made to the repository code isn't a regression the existing code was regressed already.  The project specified _USE_32BIT_TIME_T but it was previously not used properly.  With my changes the project specifying _USE_32BIT_TIME_T give the appropriate declarations and must also specify a library during the link that contains those functions.  However, the linked application might not run due to dependencies on non-standard libraries.
    
    While mingw-w64 64bit compiled code will work since _USE_32BIT_TIME_T isn't defined in tclWinPort.h because _WIN64 is defined; the mingw-w64 32bit compiled code will give the same link time error since they have no means to guard based on the version of MSVCRT.  The new code for MinGW.org _USE_32BIT_TIME_T is now more inline with that of mingw-w64 code.
    
    The resolution here is to define HAVE_32BIT_TIME_T when --with-32bit-time is specified and one of -lmsvcr80, -lmsvcr80d, -lmsvcr90, -lmsvcr90d, -lmsvcr100, -lmsvcr100d, -lmsvcr110 or -lmsvcr110d is found and the resulting binary works during configure.  Then modify tclWinPort.h to filter the define for _USE_32BIT_TIME_T based on HAVE_32BIT_TIME_T.
    
    Since a 32bit time_t is an after thought and was given to help out legacy code and since 64bit time_t is the default it should be up to the users of the source to have it enabled or not during the configure process with disabled being the default to match the compilers.
    
    
  2. login: "earnie"
  3. mimetype: "text/plain"
  4. username: "earnie"