From e211b89cf85c8b8d9ff8480a6a6f73a4abe6cda3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 19 Sep 2021 19:49:44 +0200 Subject: [PATCH] port to MSYS2/clang --- .../SetGlobalCompilerAndLinkerSettings.cmake | 32 ++++++++++++------- src/3rdParty/libkdtree/kdtree++/iterator.hpp | 4 +-- src/3rdParty/salomesmesh/CMakeLists.txt | 2 +- src/3rdParty/salomesmesh/inc/Basics_Utils.hxx | 2 +- src/3rdParty/salomesmesh/inc/ObjectPool.hxx | 6 ++-- .../salomesmesh/inc/SMDS_SpacePosition.hxx | 2 +- .../salomesmesh/inc/SMESH_ExceptHandlers.hxx | 4 +-- src/3rdParty/salomesmesh/inc/SMESH_Mesh.hxx | 2 +- .../salomesmesh/inc/Utils_ExceptHandlers.hxx | 4 +-- .../src/DriverSTL/DriverSTL_W_SMDS_Mesh.cpp | 2 ++ .../salomesmesh/src/DriverSTL/SMESH_File.cpp | 3 +- .../StdMeshers/StdMeshers_ProjectionUtils.cpp | 4 +-- src/Base/Sequencer.cpp | 8 +++++ src/Base/TimeInfo.cpp | 4 +-- src/CXX/Python3/Objects.hxx | 2 +- src/Gui/Command.h | 2 +- src/Gui/DocumentObserver.h | 2 +- src/Main/MainPy.cpp | 2 +- src/Mod/Image/Gui/OpenGLImageBox.cpp | 1 + src/Mod/Mesh/App/Core/Definitions.cpp | 4 +-- src/Mod/Part/Gui/SoBrepFaceSet.cpp | 2 +- src/Mod/Path/App/CMakeLists.txt | 9 ++++++ src/Mod/Path/libarea/kurve/geometry.h | 6 ++-- src/Mod/Points/App/Points.cpp | 6 ++-- src/Mod/Points/App/Properties.cpp | 4 +-- src/Mod/Robot/App/CMakeLists.txt | 4 +++ src/Mod/TechDraw/App/HatchLine.cpp | 4 +-- src/Mod/TechDraw/App/LineGroup.cpp | 2 +- src/zipios++/directory.cpp | 2 +- 29 files changed, 82 insertions(+), 49 deletions(-) diff --git a/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake b/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake index 514c4aad24..9a936bffbe 100644 --- a/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake +++ b/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake @@ -62,17 +62,25 @@ macro(SetGlobalCompilerAndLinkerSettings) endif(MSVC) if(MINGW) - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12477 - # Actually '-Wno-inline-dllimport' should work to suppress warnings of the form: - # inline function 'foo' is declared as dllimport: attribute ignored - # But it doesn't work with MinGW gcc 4.5.0 while using '-Wno-attributes' seems to - # do the trick. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthreads -Wno-attributes") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthreads -Wno-attributes") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mthreads -Wl,--export-all-symbols") - # http://stackoverflow.com/questions/8375310/warning-auto-importing-has-been-activated-without-enable-auto-import-specifie - # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") - link_libraries(-lgdi32) + if(CMAKE_COMPILER_IS_CLANGXX) + # clang for MSYS doesn't support -mthreads + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-attributes") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export-all-symbols") + #set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols") + else() + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12477 + # Actually '-Wno-inline-dllimport' should work to suppress warnings of the form: + # inline function 'foo' is declared as dllimport: attribute ignored + # But it doesn't work with MinGW gcc 4.5.0 while using '-Wno-attributes' seems to + # do the trick. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-attributes") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export-all-symbols") + #set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols") + # http://stackoverflow.com/questions/8375310/warning-auto-importing-has-been-activated-without-enable-auto-import-specifie + # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") + link_libraries(-lgdi32) + endif() endif(MINGW) endmacro(SetGlobalCompilerAndLinkerSettings) diff --git a/src/3rdParty/libkdtree/kdtree++/iterator.hpp b/src/3rdParty/libkdtree/kdtree++/iterator.hpp index 801dc40ae4..b6f7933442 100644 --- a/src/3rdParty/libkdtree/kdtree++/iterator.hpp +++ b/src/3rdParty/libkdtree/kdtree++/iterator.hpp @@ -54,8 +54,8 @@ namespace KDTree inline _Base_iterator(_Base_const_ptr const __N = NULL) : _M_node(__N) {} - inline _Base_iterator(_Base_iterator const& __THAT) - : _M_node(__THAT._M_node) {} + //inline _Base_iterator(_Base_iterator const& __THAT) + // : _M_node(__THAT._M_node) {} inline void _M_increment() diff --git a/src/3rdParty/salomesmesh/CMakeLists.txt b/src/3rdParty/salomesmesh/CMakeLists.txt index 104ffebba6..9f53ee423a 100644 --- a/src/3rdParty/salomesmesh/CMakeLists.txt +++ b/src/3rdParty/salomesmesh/CMakeLists.txt @@ -243,7 +243,7 @@ TARGET_LINK_LIBRARIES(DriverSTL ${SMESH_LIBS} Driver SMDS ${Boost_LIBRARIES}) SET_BIN_DIR(DriverSTL DriverSTL) if(WIN32) - set_target_properties(DriverSTL PROPERTIES COMPILE_FLAGS "-DMESHDRIVERSTL_EXPORTS -DBASICS_EXPORT -DSMESHUtils_EXPORTS -DBASICS_EXPORTS") + set_target_properties(DriverSTL PROPERTIES COMPILE_FLAGS "-DMESHDRIVERSTL_EXPORTS -DSMESHUtils_EXPORTS -DBASICS_EXPORTS") endif(WIN32) diff --git a/src/3rdParty/salomesmesh/inc/Basics_Utils.hxx b/src/3rdParty/salomesmesh/inc/Basics_Utils.hxx index 20d0923c97..3e9a2fd392 100644 --- a/src/3rdParty/salomesmesh/inc/Basics_Utils.hxx +++ b/src/3rdParty/salomesmesh/inc/Basics_Utils.hxx @@ -34,7 +34,7 @@ #else // avoid name collision with std::byte in C++17 #define NOCRYPT -#define NOGDI +#define NOGDI NOGDI #include #include #pragma comment(lib,"winmm.lib") diff --git a/src/3rdParty/salomesmesh/inc/ObjectPool.hxx b/src/3rdParty/salomesmesh/inc/ObjectPool.hxx index f27161122c..6212cbbf5c 100644 --- a/src/3rdParty/salomesmesh/inc/ObjectPool.hxx +++ b/src/3rdParty/salomesmesh/inc/ObjectPool.hxx @@ -126,14 +126,14 @@ public: void destroy(X* obj) { - long adrobj = (long) (obj); + intptr_t adrobj = (intptr_t) (obj); for (size_t i = 0; i < _chunkList.size(); i++) { X* chunk = _chunkList[i]; - long adrmin = (long) (chunk); + intptr_t adrmin = (intptr_t) (chunk); if (adrobj < adrmin) continue; - long adrmax = (long) (chunk + _chunkSize); + intptr_t adrmax = (intptr_t) (chunk + _chunkSize); if (adrobj >= adrmax) continue; int rank = (adrobj - adrmin) / sizeof(X); diff --git a/src/3rdParty/salomesmesh/inc/SMDS_SpacePosition.hxx b/src/3rdParty/salomesmesh/inc/SMDS_SpacePosition.hxx index 31f6423442..f19c752e00 100644 --- a/src/3rdParty/salomesmesh/inc/SMDS_SpacePosition.hxx +++ b/src/3rdParty/salomesmesh/inc/SMDS_SpacePosition.hxx @@ -36,7 +36,7 @@ class SMDS_EXPORT SMDS_SpacePosition:public SMDS_Position public: SMDS_SpacePosition(double x=0, double y=0, double z=0); - virtual inline SMDS_TypeOfPosition GetTypeOfPosition() const; + virtual SMDS_TypeOfPosition GetTypeOfPosition() const; static SMDS_PositionPtr originSpacePosition(); private: static SMDS_SpacePosition* _originPosition; diff --git a/src/3rdParty/salomesmesh/inc/SMESH_ExceptHandlers.hxx b/src/3rdParty/salomesmesh/inc/SMESH_ExceptHandlers.hxx index 50cd06c805..d0d8e4604c 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_ExceptHandlers.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_ExceptHandlers.hxx @@ -50,7 +50,7 @@ typedef void (*PVF)(); class SMESH_EXPORT Unexpect { //save / retrieve unexpected exceptions treatment PVF old; public : -#ifndef WNT +#ifndef _MSC_VER // std::set_unexpected has been removed in C++17 Unexpect( PVF f ) { /*old = std::set_unexpected(f);*/old = f; } @@ -66,7 +66,7 @@ class SMESH_EXPORT Terminate {//save / retrieve terminate function PVF old; public : -#ifndef WNT +#ifndef _MSC_VER Terminate( PVF f ) { old = std::set_terminate(f); } ~Terminate() { std::set_terminate(old); } diff --git a/src/3rdParty/salomesmesh/inc/SMESH_Mesh.hxx b/src/3rdParty/salomesmesh/inc/SMESH_Mesh.hxx index e5f1f1b661..a776949b58 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_Mesh.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_Mesh.hxx @@ -46,7 +46,7 @@ #include -#ifdef WIN32 +#ifdef _MSC_VER #pragma warning(disable:4251) // Warning DLL Interface ... #pragma warning(disable:4290) // Warning Exception ... #endif diff --git a/src/3rdParty/salomesmesh/inc/Utils_ExceptHandlers.hxx b/src/3rdParty/salomesmesh/inc/Utils_ExceptHandlers.hxx index 6985f8fa67..8f2362ded1 100644 --- a/src/3rdParty/salomesmesh/inc/Utils_ExceptHandlers.hxx +++ b/src/3rdParty/salomesmesh/inc/Utils_ExceptHandlers.hxx @@ -38,7 +38,7 @@ typedef void (*PVF)(); class UTILS_EXPORT Unexpect { //save / retrieve unexpected exceptions treatment PVF old; public : -#ifndef WIN32 +#ifndef _MSC_VER // std::set_unexpected has been removed in C++17 Unexpect( PVF f ) { /*old = std::set_unexpected(f);*/old = f; } @@ -54,7 +54,7 @@ class UTILS_EXPORT Terminate {//save / retrieve terminate function PVF old; public : -#ifndef WIN32 +#ifndef _MSC_VER Terminate( PVF f ) { old = std::set_terminate(f); } ~Terminate() { std::set_terminate(old); } diff --git a/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cpp b/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cpp index 05b0480936..749f241ec0 100644 --- a/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cpp +++ b/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cpp @@ -23,8 +23,10 @@ #include "DriverSTL_W_SMDS_Mesh.h" #ifdef WIN32 +#ifndef NOMINMAX #define NOMINMAX #endif +#endif #include diff --git a/src/3rdParty/salomesmesh/src/DriverSTL/SMESH_File.cpp b/src/3rdParty/salomesmesh/src/DriverSTL/SMESH_File.cpp index 43d567298c..481110f4b2 100644 --- a/src/3rdParty/salomesmesh/src/DriverSTL/SMESH_File.cpp +++ b/src/3rdParty/salomesmesh/src/DriverSTL/SMESH_File.cpp @@ -141,7 +141,8 @@ void SMESH_File::close() _pos = _end = 0; _size = -1; } - else if ( _file >= 0 ) + //else if ( _file >= 0 ) + else if ( _file != 0 ) { #ifdef WIN32 if(_file != INVALID_HANDLE_VALUE) { diff --git a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_ProjectionUtils.cpp b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_ProjectionUtils.cpp index 4905d0d062..5ec96bdbec 100644 --- a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_ProjectionUtils.cpp +++ b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_ProjectionUtils.cpp @@ -102,11 +102,11 @@ namespace HERE = StdMeshers_ProjectionUtils; namespace { static SMESHDS_Mesh* theMeshDS[2] = { 0, 0 }; // used for debug only - inline long shapeIndex(const TopoDS_Shape& S) + inline intptr_t shapeIndex(const TopoDS_Shape& S) { if ( theMeshDS[0] && theMeshDS[1] ) return max(theMeshDS[0]->ShapeToIndex(S), theMeshDS[1]->ShapeToIndex(S) ); - return long(S.TShape().operator->()); + return intptr_t(S.TShape().operator->()); } //================================================================================ diff --git a/src/Base/Sequencer.cpp b/src/Base/Sequencer.cpp index 751a6273de..57cd67904f 100644 --- a/src/Base/Sequencer.cpp +++ b/src/Base/Sequencer.cpp @@ -41,7 +41,11 @@ namespace Base { // members static std::vector _instances; /**< A vector of all created instances */ static SequencerLauncher* _topLauncher; /**< The outermost launcher */ +#if QT_VERSION >= QT_VERSION_CHECK(5,14,0) + static QRecursiveMutex mutex; /**< A mutex-locker for the launcher */ +#else static QMutex mutex; /**< A mutex-locker for the launcher */ +#endif /** Sets a global sequencer object. * Access to the last registered object is performed by @see Sequencer(). */ @@ -67,7 +71,11 @@ namespace Base { */ std::vector SequencerP::_instances; SequencerLauncher* SequencerP::_topLauncher = 0; +#if QT_VERSION >= QT_VERSION_CHECK(5,14,0) + QRecursiveMutex SequencerP::mutex; +#else QMutex SequencerP::mutex(QMutex::Recursive); +#endif } SequencerBase& SequencerBase::Instance () diff --git a/src/Base/TimeInfo.cpp b/src/Base/TimeInfo.cpp index 03cbff2959..d34dc6edbe 100644 --- a/src/Base/TimeInfo.cpp +++ b/src/Base/TimeInfo.cpp @@ -26,7 +26,7 @@ #ifndef _PreComp_ # include # include -# if defined(FC_OS_LINUX) +# if defined(FC_OS_LINUX) || defined(__MINGW32__) # include # endif #endif @@ -60,7 +60,7 @@ TimeInfo::~TimeInfo() void TimeInfo::setCurrent(void) { -#if defined (FC_OS_BSD) || defined(FC_OS_LINUX) +#if defined (FC_OS_BSD) || defined(FC_OS_LINUX) || defined(__MINGW32__) struct timeval t; gettimeofday(&t, NULL); timebuffer.time = t.tv_sec; diff --git a/src/CXX/Python3/Objects.hxx b/src/CXX/Python3/Objects.hxx index 08f77df6c1..d86cd138a1 100644 --- a/src/CXX/Python3/Objects.hxx +++ b/src/CXX/Python3/Objects.hxx @@ -55,7 +55,7 @@ namespace Py { typedef Py_ssize_t sequence_index_type; // type of an index into a sequence - Py_ssize_t numeric_limits_max(); + PYCXX_EXPORT Py_ssize_t numeric_limits_max(); // Forward declarations class Object; diff --git a/src/Gui/Command.h b/src/Gui/Command.h index f03fd22de8..852da24852 100644 --- a/src/Gui/Command.h +++ b/src/Gui/Command.h @@ -454,7 +454,7 @@ public: * * @sa Command::_doCommand() */ -#ifdef FC_OS_WIN32 +#ifdef _MSC_VER #define doCommand(_type,...) _doCommand(__FILE__,__LINE__,_type,##__VA_ARGS__) #else #define doCommand(...) _doCommand(__FILE__,__LINE__,__VA_ARGS__) diff --git a/src/Gui/DocumentObserver.h b/src/Gui/DocumentObserver.h index 90f84dcd00..6608fa9df7 100644 --- a/src/Gui/DocumentObserver.h +++ b/src/Gui/DocumentObserver.h @@ -165,7 +165,7 @@ private: /** * @brief The ViewProviderWeakPtrT class */ -class AppExport ViewProviderWeakPtrT +class GuiExport ViewProviderWeakPtrT { public: ViewProviderWeakPtrT(ViewProviderDocumentObject*); diff --git a/src/Main/MainPy.cpp b/src/Main/MainPy.cpp index 10ed3a39c1..739deb9afc 100644 --- a/src/Main/MainPy.cpp +++ b/src/Main/MainPy.cpp @@ -56,7 +56,7 @@ /** DllMain is called when DLL is loaded */ -BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID /*lpReserved*/) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: { diff --git a/src/Mod/Image/Gui/OpenGLImageBox.cpp b/src/Mod/Image/Gui/OpenGLImageBox.cpp index bb22ae0f83..3c4a6e2441 100644 --- a/src/Mod/Image/Gui/OpenGLImageBox.cpp +++ b/src/Mod/Image/Gui/OpenGLImageBox.cpp @@ -31,6 +31,7 @@ #if defined(__MINGW32__) # include +# include # include #elif defined (FC_OS_MACOSX) # include diff --git a/src/Mod/Mesh/App/Core/Definitions.cpp b/src/Mod/Mesh/App/Core/Definitions.cpp index 5c0f66290b..ebbdec2b6d 100644 --- a/src/Mod/Mesh/App/Core/Definitions.cpp +++ b/src/Mod/Mesh/App/Core/Definitions.cpp @@ -30,8 +30,8 @@ namespace MeshCore { -template<> const float Math ::PI = (float)(4.0*atan(1.0)); -template<> const double Math::PI = 4.0*atan(1.0); +template<> MeshExport const float Math ::PI = (float)(4.0*atan(1.0)); +template<> MeshExport const double Math::PI = 4.0*atan(1.0); float MeshDefinitions::_fMinPointDistance = float(MESH_MIN_PT_DIST); float MeshDefinitions::_fMinPointDistanceP2 = _fMinPointDistance * _fMinPointDistance; diff --git a/src/Mod/Part/Gui/SoBrepFaceSet.cpp b/src/Mod/Part/Gui/SoBrepFaceSet.cpp index b000c03966..a2fe4d2bd7 100644 --- a/src/Mod/Part/Gui/SoBrepFaceSet.cpp +++ b/src/Mod/Part/Gui/SoBrepFaceSet.cpp @@ -1471,7 +1471,7 @@ void SoBrepFaceSet::VBO::render(SoGLRenderAction * action, const cc_glglue * glue = cc_glglue_instance(action->getCacheContext()); PFNGLBINDBUFFERARBPROC glBindBufferARB = (PFNGLBINDBUFFERARBPROC) cc_glglue_getprocaddress(glue, "glBindBufferARB"); - PFNGLMAPBUFFERARBPROC glMapBufferARB = (PFNGLMAPBUFFERARBPROC) cc_glglue_getprocaddress(glue, "glMapBufferARB"); + //PFNGLMAPBUFFERARBPROC glMapBufferARB = (PFNGLMAPBUFFERARBPROC) cc_glglue_getprocaddress(glue, "glMapBufferARB"); PFNGLGENBUFFERSPROC glGenBuffersARB = (PFNGLGENBUFFERSPROC)cc_glglue_getprocaddress(glue, "glGenBuffersARB"); PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)cc_glglue_getprocaddress(glue, "glDeleteBuffersARB"); PFNGLBUFFERDATAARBPROC glBufferDataARB = (PFNGLBUFFERDATAARBPROC)cc_glglue_getprocaddress(glue, "glBufferDataARB"); diff --git a/src/Mod/Path/App/CMakeLists.txt b/src/Mod/Path/App/CMakeLists.txt index 2ec0a12615..fa9a52c302 100644 --- a/src/Mod/Path/App/CMakeLists.txt +++ b/src/Mod/Path/App/CMakeLists.txt @@ -145,6 +145,15 @@ target_link_libraries(Path ${Path_LIBS}) if(NOT ${Boost_VERSION} LESS 107500) set_target_properties(Path PROPERTIES CXX_STANDARD_REQUIRED ON) set_target_properties(Path PROPERTIES CXX_STANDARD 14) + + # Suppress -Wc++17-extensions when using OCCT 7.5 or newer + if (MINGW AND CMAKE_COMPILER_IS_CLANGXX) + unset(_flag_found CACHE) + check_cxx_compiler_flag("-Wno-c++17-extensions" _flag_found) + if (_flag_found) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++17-extensions") + endif() + endif() endif() if(FREECAD_USE_PCH) diff --git a/src/Mod/Path/libarea/kurve/geometry.h b/src/Mod/Path/libarea/kurve/geometry.h index 0148d0552b..58e6041dd1 100644 --- a/src/Mod/Path/libarea/kurve/geometry.h +++ b/src/Mod/Path/libarea/kurve/geometry.h @@ -10,7 +10,7 @@ // ///////////////////////////////////////////////////////////////////////////////////////// #pragma once -#ifdef WIN32 +#ifdef _MSC_VER #pragma warning( disable : 4996 ) #ifndef WINVER #define WINVER 0x501 @@ -772,7 +772,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) > -#ifdef WIN32 +#ifdef _MSC_VER #pragma warning(disable:4522) #endif @@ -902,7 +902,7 @@ inline bool FNEZ(double a, double tolerance = TIGHT_TOLERANCE) {return fabs(a) > PK_BODY_t ToPKlofted_thickened_body(Kurve &sec, double thickness); #endif }; -#ifdef WIN32 +#ifdef _MSC_VER #pragma warning(default:4522) #endif diff --git a/src/Mod/Points/App/Points.cpp b/src/Mod/Points/App/Points.cpp index a568bdb68c..947c27cee3 100644 --- a/src/Mod/Points/App/Points.cpp +++ b/src/Mod/Points/App/Points.cpp @@ -40,7 +40,7 @@ #include "PointsAlgos.h" #include "PointsPy.h" -#ifdef _WIN32 +#ifdef _MSC_VER # include #endif @@ -85,7 +85,7 @@ Data::Segment* PointKernel::getSubElement(const char* /*Type*/, unsigned long /* void PointKernel::transformGeometry(const Base::Matrix4D &rclMat) { std::vector& kernel = getBasicPoints(); -#ifdef _WIN32 +#ifdef _MSC_VER // Win32-only at the moment since ppl.h is a Microsoft library. Points is not using Qt so we cannot use QtConcurrent // We could also rewrite Points to leverage SIMD instructions // Other option: openMP. But with VC2013 results in high CPU usage even after computation (busy-waits for >100ms) @@ -103,7 +103,7 @@ Base::BoundBox3d PointKernel::getBoundBox(void)const { Base::BoundBox3d bnd; -#ifdef _WIN32 +#ifdef _MSC_VER // Thread-local bounding boxes Concurrency::combinable bbs; // Cannot use a const_point_iterator here as it is *not* a proper iterator (fails the for_each template) diff --git a/src/Mod/Points/App/Properties.cpp b/src/Mod/Points/App/Properties.cpp index 4d6b87d86d..77099e6d6b 100644 --- a/src/Mod/Points/App/Properties.cpp +++ b/src/Mod/Points/App/Properties.cpp @@ -41,7 +41,7 @@ #include "PointsPy.h" #include -#ifdef _WIN32 +#ifdef _MSC_VER # include #endif @@ -393,7 +393,7 @@ void PropertyNormalList::transformGeometry(const Base::Matrix4D &mat) aboutToSetValue(); // Rotate the normal vectors -#ifdef _WIN32 +#ifdef _MSC_VER Concurrency::parallel_for_each(_lValueList.begin(), _lValueList.end(), [rot](Base::Vector3f& value) { value = rot * value; }); diff --git a/src/Mod/Robot/App/CMakeLists.txt b/src/Mod/Robot/App/CMakeLists.txt index 383386c01b..a7cbaf55bf 100644 --- a/src/Mod/Robot/App/CMakeLists.txt +++ b/src/Mod/Robot/App/CMakeLists.txt @@ -131,6 +131,10 @@ if (_flag_found) target_compile_options(Robot PRIVATE -Wno-deprecated-copy) endif() +if(MINGW) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols") +endif() + SET_BIN_DIR(Robot Robot /Mod/Robot) SET_PYTHON_PREFIX_SUFFIX(Robot) diff --git a/src/Mod/TechDraw/App/HatchLine.cpp b/src/Mod/TechDraw/App/HatchLine.cpp index 00bfc7e4a5..d9602a6f8b 100644 --- a/src/Mod/TechDraw/App/HatchLine.cpp +++ b/src/Mod/TechDraw/App/HatchLine.cpp @@ -337,7 +337,7 @@ bool PATLineSpec::findPatternStart(std::ifstream& inFile, std::string& parmName std::getline(inFile,line); std::string nameTag = line.substr(0,1); std::string patternName; - unsigned long int commaPos; + std::size_t commaPos; if ((nameTag == ";") || (nameTag == " ") || (line.empty()) ) { //is cr/lf empty? @@ -394,7 +394,7 @@ std::vector PATLineSpec::getPatternList(std::string& parmFile) std::string line; std::getline(inFile,line); std::string nameTag = line.substr(0,1); //dupl code here - unsigned long int commaPos; + std::size_t commaPos; if (nameTag == "*") { //found a pattern commaPos = line.find(',',1); std::string patternName; diff --git a/src/Mod/TechDraw/App/LineGroup.cpp b/src/Mod/TechDraw/App/LineGroup.cpp index 05f3da24d8..3b2dc9bc85 100644 --- a/src/Mod/TechDraw/App/LineGroup.cpp +++ b/src/Mod/TechDraw/App/LineGroup.cpp @@ -208,7 +208,7 @@ std::string LineGroup::getGroupNamesFromFile(std::string FileName) std::getline(inFile, line); std::string nameTag = line.substr(0, 1); std::string found; - unsigned long int commaPos; + std::size_t commaPos; if (nameTag == "*") { commaPos = line.find(',', 1); if (commaPos != std::string::npos) { diff --git a/src/zipios++/directory.cpp b/src/zipios++/directory.cpp index 7dc7a28a08..ec05488fe2 100644 --- a/src/zipios++/directory.cpp +++ b/src/zipios++/directory.cpp @@ -317,7 +317,7 @@ namespace boost { return (it.rep->get_data().attrib & _A_HIDDEN) != 0; } - template <> bool get(dir_it const &it) + template <> bool get(dir_it const & /*it*/) { return true; }