Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-34038

localtime_r not declared in qtdeclarative\src\qml\jsruntime\qv4dateobject.cpp

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.2.0 RC1
    • 5.2.0 Alpha
    • None
    • ce3e8f93c3a4d5f89b371b9e3598c8e39d4c12e4 8078e2ea1350fd5109074a2be7207d75840e57f7

    Description

      Hi, I get this compile error for latest stable branch (in all subrepositories latest stable too):

      C:\Git\Qt5\qtdeclarative\src\qml\jsruntime\qv4dateobject.cpp:300:48: error: 'localtime_r' was not declared in this scope
           if (!localtime_r((const time_t*) &tt, &tmtm))

      After adding

      struct tm *
      localtime_r (const time_t *timer, struct tm *result)
      {
         struct tm *local_result;
         local_result = localtime (timer);
      
         if (local_result == NULL || result == NULL)
           return NULL;
      
         memcpy (result, local_result, sizeof (result));
         return result;
      }

      from http://lists-archives.com/mingw-users/09680-porting-localtime_r-and-gmtime_r.html the file compiles fine. But I'm not sure whether this implementation is truly reentrant.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kkohne Kai Köhne
            alexl Alexander Lanin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes