diff --git a/qgroundcontrol.pri b/qgroundcontrol.pri index 3578923..978551a 100644 --- a/qgroundcontrol.pri +++ b/qgroundcontrol.pri @@ -405,6 +405,10 @@ win32-g++ { CONFIG += CONSOLE OUTPUT += CONSOLE + # The EIGEN library needs this define + # to make the internal min/max functions work + DEFINES += NOMINMAX + INCLUDEPATH += $$BASEDIR/lib/sdl/include \ $$BASEDIR/lib/opal/include #\ #\ #"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include" diff --git a/src/libs/qextserialport/qextserialenumerator_win.cpp b/src/libs/qextserialport/qextserialenumerator_win.cpp index 07d348f..1f205ac 100644 --- a/src/libs/qextserialport/qextserialenumerator_win.cpp +++ b/src/libs/qextserialport/qextserialenumerator_win.cpp @@ -9,6 +9,13 @@ #include //#include "qextserialport.h" #include +#ifdef Q_OS_WIN +#ifndef _MSC_VER +#include +#include +#include +#endif +#endif QextSerialEnumerator::QextSerialEnumerator( ) { @@ -193,12 +200,12 @@ bool QextSerialEnumerator::getDeviceDetailsWin( QextPortInfo* portInfo, HDEVINFO QString hardwareIDs = getDeviceProperty(devInfo, devData, SPDRP_HARDWAREID); HKEY devKey = SetupDiOpenDevRegKey(devInfo, devData, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ); - QRegExp rx("^COM(\\d+)"); - QString fullName(getRegKeyValue(devKey, TEXT("PortName"))); - if(fullName.contains(rx)) { - int portnum = rx.cap(1).toInt(); - if(portnum > 9) // COM ports greater than 9 need \\.\ prepended - fullName.prepend("\\\\.\\"); + QRegExp rx("^COM(\\d+)"); + QString fullName(getRegKeyValue(devKey, TEXT("PortName"))); + if(fullName.contains(rx)) { + int portnum = rx.cap(1).toInt(); + if(portnum > 9) // COM ports greater than 9 need \\.\ prepended + fullName.prepend("\\\\.\\"); } portInfo->portName = fullName;