From c62765eb90dc57191d45426273c22ab29cfc1ce1 Mon Sep 17 00:00:00 2001 From: LM Date: Thu, 21 Jul 2011 14:07:07 +0200 Subject: [PATCH] Fixed compile errors and warnings for Windows. --- qgroundcontrol.pri | 6 ++++++ src/QGC.h | 19 ++++++++++++++++--- src/comm/MAVLinkSimulationWaypointPlanner.cc | 6 +++--- src/uas/QGCUASParamManager.cc | 2 +- src/ui/HUD.cc | 14 -------------- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/qgroundcontrol.pri b/qgroundcontrol.pri index 874e48fee..357892382 100644 --- a/qgroundcontrol.pri +++ b/qgroundcontrol.pri @@ -320,8 +320,14 @@ win32-msvc2008 { message(Building for Windows Visual Studio 2008 (32bit)) + # QAxContainer support is needed for the Internet Control + # element showing the Google Earth window CONFIG += qaxcontainer + # The EIGEN library needs this define + # to make the internal min/max functions work + DEFINES += NOMINMAX + # QWebkit is not needed on MS-Windows compilation environment CONFIG -= webkit diff --git a/src/QGC.h b/src/QGC.h index 6ddd5fc67..9a1b442d1 100644 --- a/src/QGC.h +++ b/src/QGC.h @@ -33,9 +33,22 @@ /* Windows fixes */ #ifdef _MSC_VER -#include -#define isnan(x) _isnan(x) -#define isinf(x) (!_finite(x)) +/* Needed define for Eigen */ +//#define NOMINMAX +#include +template +inline bool isnan(T value) +{ + return value != value; + +} + +// requires #include +template +inline bool isinf(T value) +{ + return std::numeric_limits::has_infinity && (value == std::numeric_limits::infinity() || (-1*value) == std::numeric_limits::infinity()); +} #else #include #ifndef isnan diff --git a/src/comm/MAVLinkSimulationWaypointPlanner.cc b/src/comm/MAVLinkSimulationWaypointPlanner.cc index f2e0acc48..d78b4d5bf 100644 --- a/src/comm/MAVLinkSimulationWaypointPlanner.cc +++ b/src/comm/MAVLinkSimulationWaypointPlanner.cc @@ -820,7 +820,7 @@ void MAVLinkSimulationWaypointPlanner::mavlink_handler (const mavlink_message_t* mavlink_msg_action_decode(msg, &action); if(action.target == systemid) { if (verbose) qDebug("Waypoint: received message with action %d\n", action.action); - switch (action.action) { +// switch (action.action) { // case MAV_ACTION_LAUNCH: // if (verbose) std::cerr << "Launch received" << std::endl; // current_active_wp_id = 0; @@ -847,10 +847,10 @@ void MAVLinkSimulationWaypointPlanner::mavlink_handler (const mavlink_message_t* // default: // if (verbose) std::cerr << "Unknown action received with id " << action.action << ", no action taken" << std::endl; // break; - } +// } } break; - } + } case MAVLINK_MSG_ID_WAYPOINT_ACK: { mavlink_waypoint_ack_t wpa; diff --git a/src/uas/QGCUASParamManager.cc b/src/uas/QGCUASParamManager.cc index 82ea6f514..d6e9a6bc4 100644 --- a/src/uas/QGCUASParamManager.cc +++ b/src/uas/QGCUASParamManager.cc @@ -20,7 +20,7 @@ QGCUASParamManager::QGCUASParamManager(UASInterface* uas, QWidget *parent) : */ void QGCUASParamManager::requestParameterListUpdate(int component) { - + Q_UNUSED(component); } diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index 3a5ac60a4..e186b0a2d 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -51,20 +51,6 @@ This file is part of the QGROUNDCONTROL project #define GL_MULTISAMPLE 0x809D #endif -template -inline bool isnan(T value) -{ - return value != value; - -} - -// requires #include -template -inline bool isinf(T value) -{ - return std::numeric_limits::has_infinity && (value == std::numeric_limits::infinity() || (-1*value) == std::numeric_limits::infinity()); -} - /** * @warning The HUD widget will not start painting its content automatically * to update the view, start the auto-update by calling HUD::start(). -- 2.22.0