Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 19, 2019
1 parent 8cff941 commit ab340f2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/3d/terrain/qgsdemterraintilegeometry_p.cpp
Expand Up @@ -297,11 +297,12 @@ static bool intersectionDemTriangles( const QByteArray &vertexBuf, const QByteAr

const float *vertices = reinterpret_cast<const float *>( vertexBuf.constData() );
const uint *indices = reinterpret_cast<const uint *>( indexBuf.constData() );
#ifdef QGISDEBUG
int vertexCnt = vertexBuf.count() / sizeof( float );
int indexCnt = indexBuf.count() / sizeof( uint );
Q_ASSERT( vertexCnt % 8 == 0 );
#endif
int indexCnt = indexBuf.count() / sizeof( uint );
Q_ASSERT( indexCnt % 3 == 0 );
//int vertexCount = vertexCnt/8;
int triangleCount = indexCnt / 3;

QVector3D intersectionPt, minIntersectionPt;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsprojutils.cpp
Expand Up @@ -23,7 +23,7 @@
#endif


#ifdef USE_THREAD_LOCAL
#if defined(USE_THREAD_LOCAL) && !defined(Q_OS_WIN)
thread_local QgsProjContext QgsProjContext::sProjContext;
#else
QThreadStorage< QgsProjContext * > QgsProjContext::sProjContext;
Expand All @@ -49,7 +49,7 @@ QgsProjContext::~QgsProjContext()

PJ_CONTEXT *QgsProjContext::get()
{
#ifdef USE_THREAD_LOCAL
#if defined(USE_THREAD_LOCAL) && !defined(Q_OS_WIN)
return sProjContext.mContext;
#else
PJ_CONTEXT *pContext = nullptr;
Expand Down
6 changes: 4 additions & 2 deletions src/core/qgsprojutils.h
Expand Up @@ -17,10 +17,12 @@
#ifndef QGSPROJUTILS_H
#define QGSPROJUTILS_H

#include <QtGlobal>

#include "qgis_core.h"
#include "qgsconfig.h"

#ifndef USE_THREAD_LOCAL
#if !defined(USE_THREAD_LOCAL) || defined(Q_OS_WIN)
#include <QThreadStorage>
#endif

Expand Down Expand Up @@ -59,7 +61,7 @@ class CORE_EXPORT QgsProjContext
* Thread local proj context storage. A new proj context will be created
* for every thread.
*/
#ifdef USE_THREAD_LOCAL
#if defined(USE_THREAD_LOCAL) && !defined(Q_OS_WIN)
static thread_local QgsProjContext sProjContext;
#else
static QThreadStorage< QgsProjContext * > sProjContext;
Expand Down
3 changes: 2 additions & 1 deletion tests/src/core/testqgscoordinatereferencesystem.cpp
Expand Up @@ -123,7 +123,8 @@ void TestQgsCoordinateReferenceSystem::initTestCase()
qDebug() << "GDAL version (build): " << GDAL_RELEASE_NAME;
qDebug() << "GDAL version (runtime): " << GDALVersionInfo( "RELEASE_NAME" );
#if PROJ_VERSION_MAJOR > 4
qDebug() << "PROJ version: " << pj_release;
PJ_INFO info = proj_info();
qDebug() << "PROJ version: " << info.release;
#else
qDebug() << "PROJ version: " << PJ_VERSION;
#endif
Expand Down

0 comments on commit ab340f2

Please sign in to comment.