Menu

#2 difftime requires implementation

closed
CRT (12)
6
2007-10-03
2007-10-01
NightStrike
No

difftime32() and difftime64() do not have an implementation. Therefore, programs that use the difftime() function will fail to link. These features should be added to allow compatibility with the expected results.

Discussion

  • Kai Tietz

    Kai Tietz - 2007-10-02
    • status: open --> closed
     
  • Kai Tietz

    Kai Tietz - 2007-10-02

    Logged In: YES
    user_id=1598680
    Originator: NO

    This feature was added by revision 95 to svn repository.

    Cheers,
    Kai

     
  • NightStrike

    NightStrike - 2007-10-02
    • status: closed --> open
     
  • NightStrike

    NightStrike - 2007-10-02

    Logged In: YES
    user_id=1864092
    Originator: YES

    Line 5 is missing a close parenthesis:

    ./misc/difftime32.c: In function '_difftime32':
    ./misc/difftime32.c:5: error: expected ')' before ';' token
    ./misc/difftime32.c:7: error: expected ';' before '}' token
    make: *** [difftime32.o] Error 1

    This should do it:

    Index: difftime32.c

    --- difftime32.c (revision 97)
    +++ difftime32.c (working copy)
    @@ -2,6 +2,6 @@ double _difftime32(unsigned int _Time1,u
    {
    unsigned int r = _Time2 - _Time1;
    if (r > _Time2)
    - return -((double) (_Time1 - _Time2);
    + return -((double) (_Time1 - _Time2));
    return (double) r;
    }

    Can someone approve that fix?

     
  • FX

    FX - 2007-10-03

    Logged In: YES
    user_id=865300
    Originator: NO

    misc/difftim64.c is also missing a closing parenthesis.

    Index: misc/difftime64.c

    --- misc/difftime64.c (revision 97)
    +++ misc/difftime64.c (working copy)
    @@ -2,6 +2,6 @@ double _difftime64(unsigned long long _T
    {
    unsigned long long r = _Time2 - _Time1;
    if (r > _Time2)
    - return -((double) (_Time1 - _Time2);
    + return -((double) (_Time1 - _Time2));
    return (double) r;
    }
    Index: misc/difftime32.c
    ===================================================================
    --- misc/difftime32.c (revision 97)
    +++ misc/difftime32.c (working copy)
    @@ -2,6 +2,6 @@ double _difftime32(unsigned int _Time1,u
    {
    unsigned int r = _Time2 - _Time1;
    if (r > _Time2)
    - return -((double) (_Time1 - _Time2);
    + return -((double) (_Time1 - _Time2));
    return (double) r;
    }

     
  • NightStrike

    NightStrike - 2007-10-03
    • status: open --> closed
     
  • NightStrike

    NightStrike - 2007-10-03

    Logged In: YES
    user_id=1864092
    Originator: YES

    I went ahead and committed these as obvious to revision 98. I thought it'd be better to get a working crt again than to wait given that this is simple. I hope Kai doesn't mind :)

     

Log in to post a comment.