From d6831fc6c615da8546cfbb731a4ac63e2293d250 Mon Sep 17 00:00:00 2001 From: codestation Date: Thu, 19 Dec 2013 00:03:13 -0430 Subject: [PATCH] Fix compilation under 64bit Windows and standarize the format of the thread ID. --- qcma.pro | 2 +- src/cmaclient.cpp | 4 ++-- src/cmaevent.cpp | 4 ++-- src/main.cpp | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/qcma.pro b/qcma.pro index e68885d..0f6d13b 100644 --- a/qcma.pro +++ b/qcma.pro @@ -64,7 +64,7 @@ INCLUDEPATH += src/ CONFIG += link_pkgconfig PKGCONFIG += libvitamtp libavformat libavcodec libavutil libswscale -QMAKE_CXXFLAGS += -Wno-write-strings -Wall -D__STDC_CONSTANT_MACROS +QMAKE_CXXFLAGS += -Wno-write-strings -Wall -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS RESOURCES += qcmares.qrc diff --git a/src/cmaclient.cpp b/src/cmaclient.cpp index 6bf5594..43a22fa 100644 --- a/src/cmaclient.cpp +++ b/src/cmaclient.cpp @@ -53,7 +53,7 @@ void CmaClient::connectUsb() { vita_device_t *vita; - qDebug("Starting usb_thread: %lu", (unsigned long)QThread::currentThreadId()); + qDebug("Starting usb_thread: 0x%016" PRIxPTR, (quintptr)QThread::currentThreadId()); setActive(true); @@ -84,7 +84,7 @@ void CmaClient::connectWireless() QTime now = QTime::currentTime(); qsrand(now.msec()); - qDebug("Starting wireless_thread: %lu", (unsigned long)QThread::currentThreadId()); + qDebug("Starting wireless_thread: 0x%016" PRIxPTR, (quintptr)QThread::currentThreadId()); setActive(true); diff --git a/src/cmaevent.cpp b/src/cmaevent.cpp index 258595a..f2dd082 100644 --- a/src/cmaevent.cpp +++ b/src/cmaevent.cpp @@ -26,7 +26,6 @@ #include #include -#define __STDC_FORMAT_MACROS #include Database *CmaEvent::db = NULL; @@ -40,7 +39,8 @@ CmaEvent::CmaEvent(vita_device_t *s_device) : void CmaEvent::process() { - qDebug("Starting event_thread: %lu", (unsigned long)QThread::currentThreadId()); + qDebug("Starting event_thread: 0x%016" PRIxPTR, (quintptr)QThread::currentThreadId()); + while(true) { sema.acquire(); if(!isActive()) { diff --git a/src/main.cpp b/src/main.cpp index 3e4216d..605006b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,6 +26,8 @@ #include #include +#include + #include "singleapplication.h" #include "mainwidget.h" @@ -87,7 +89,7 @@ int main(int argc, char *argv[]) app.installTranslator(&translator); } - qDebug("Starting main thread: %lu", (unsigned long)QThread::currentThreadId()); + qDebug("Starting main thread: 0x%016" PRIxPTR, (quintptr)QThread::currentThreadId()); // set the organization/application for QSettings to work properly app.setOrganizationName("qcma");