#12 Fixing linux build

This commit is contained in:
Roland Winklmeier
2013-03-30 17:41:04 +01:00
parent eea8405e1c
commit 585c4db578
27 changed files with 68 additions and 37 deletions

View File

@@ -8,6 +8,10 @@ INCLUDEPATH += ..
DEPENDPATH += . ..
linux-g++* {
QMAKE_CXXFLAGS += -std=c++0x
}
#PRECOMPILED_HEADER = stdpch.h
precompile_header:!isEmpty(PRECOMPILED_HEADER) {

View File

@@ -8,6 +8,8 @@
#include "mathematics.h"
#include <math.h>
namespace BlackCore
{
namespace Constants

View File

@@ -21,7 +21,7 @@ namespace FSD
class FSD_MSG : public BlackMisc::IMessage
{
public:
FSD_MSG(QString& id) : IMessage(id)
FSD_MSG(QString id) : IMessage(id)
{
}
@@ -40,7 +40,7 @@ namespace FSD
class FSD_MSG_AddPilot : public FSD_MSG
{
public:
FSD_MSG_AddPilot() : FSD_MSG(QString("#AP")), m_revision(VATSIM_PROTOCOL_REV),
FSD_MSG_AddPilot() : FSD_MSG("#AP"), m_revision(VATSIM_PROTOCOL_REV),
m_rating(1)
{
}

View File

@@ -25,7 +25,7 @@ double CMath::hypot(double x, double y)
double CMath::cubicRootReal(const double x)
{
double result;
result = std::pow(std::abs(x), (double)1/3);
result = pow(abs(x), (double)1/3);
return x < 0 ? -result : result;
}

View File

@@ -6,6 +6,8 @@
#ifndef MATH_H
#define MATH_H
#include <math.h>
namespace BlackCore
{

View File

@@ -92,6 +92,8 @@ namespace BlackCore {
bool beaconLights; //!< true if beacon lights on
};
#ifdef Q_OS_WIN
//! A callback that is called when the simulator is started.
typedef std::tr1::function<void(const bool status)> cbSimStarted;
@@ -104,6 +106,20 @@ namespace BlackCore {
//! A callback that is called when the user's plane changes its model.
typedef std::tr1::function<void(const CPlaneModel &model)> cbChangedModel;
#else
//! A callback that is called when the simulator is started.
typedef std::function<void(const bool status)> cbSimStarted;
//! A callback that is called when the user's plane changes its avionics state.
typedef std::function<void(const CAvionicsState &state)> cbChangedAvionicsState;
//! A callback that is called when the user's plane changes its animation state.
typedef std::function<void(const CAnimationState &state)> cbChangedAnimationState;
//! A callback that is called when the user's plane changes its model.
typedef std::function<void(const CPlaneModel &model)> cbChangedModel;
#endif
/*!
* The interface that is implemented by each simulator driver.
*
@@ -200,14 +216,25 @@ namespace BlackCore {
virtual bool setAnimationState(const qint32 planeID, const CAnimationState &state) = 0;
//! Calls the supplied visitor function once for every model available in the simulator.
#ifdef Q_OS_WIN
virtual void visitAllModels(const std::tr1::function<void(const CPlaneModel &)> &visitor) = 0;
#else
virtual void visitAllModels(const std::function<void(const CPlaneModel &)> &visitor) = 0;
#endif
/*!
* Fills container with all models.
* Class T must be a container of CPlaneModel objects and must support push_back.
*/
#ifdef Q_OS_WIN
template <class T>
void getAllModels(T &container) { visitAllModels(std::tr1::bind(T::push_back, container)); }
#else
template <class T>
void getAllModels(T &container) { visitAllModels(std::bind(T::push_back, container)); }
#endif
protected:
BlackMisc::IContext *m_libraryContext; //!< The global context.