From b88535621f352158967293b8fae941f9ffccba47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sch=C3=B6berl=2C=20Joachim?= Date: Sun, 11 Feb 2024 11:02:18 +0100 Subject: [PATCH] Removewinheader --- libsrc/general/gzstream.cpp | 6 +++--- libsrc/general/gzstream.h | 14 +++++++------- libsrc/general/myadt.hpp | 1 - libsrc/general/parthreads.hpp | 8 ++++---- libsrc/general/template.hpp | 2 +- libsrc/include/incopengl.hpp | 1 + libsrc/include/mystdlib.h | 13 +++++++++---- libsrc/meshing/meshing.hpp | 8 ++++++++ libsrc/stlgeom/stlpkg.cpp | 5 +++++ libsrc/visualization/visual.hpp | 7 ------- libsrc/visualization/visualpkg.cpp | 3 +-- ng/gui.cpp | 7 ++++++- ng/ngappinit.cpp | 5 +++++ 13 files changed, 50 insertions(+), 30 deletions(-) diff --git a/libsrc/general/gzstream.cpp b/libsrc/general/gzstream.cpp index 49003377..968c07f9 100644 --- a/libsrc/general/gzstream.cpp +++ b/libsrc/general/gzstream.cpp @@ -44,7 +44,7 @@ namespace GZSTREAM_NAMESPACE { // class gzstreambuf: // -------------------------------------- -gzstreambuf* gzstreambuf::open( const filesystem::path & name, int open_mode) { + gzstreambuf* gzstreambuf::open( const std::filesystem::path & name, int open_mode) { if ( is_open()) return (gzstreambuf*)0; mode = open_mode; @@ -143,7 +143,7 @@ int gzstreambuf::sync() { // class gzstreambase: // -------------------------------------- -gzstreambase::gzstreambase( const filesystem::path & name, int mode) { + gzstreambase::gzstreambase( const std::filesystem::path & name, int mode) { init( &buf); open( name.c_str(), mode); } @@ -152,7 +152,7 @@ gzstreambase::~gzstreambase() { buf.close(); } -void gzstreambase::open( const filesystem::path & name, int open_mode) { + void gzstreambase::open( const std::filesystem::path & name, int open_mode) { if ( ! buf.open( name.c_str(), open_mode)) clear( rdstate() | std::ios::badbit); } diff --git a/libsrc/general/gzstream.h b/libsrc/general/gzstream.h index 7528b5f0..20a77795 100644 --- a/libsrc/general/gzstream.h +++ b/libsrc/general/gzstream.h @@ -62,7 +62,7 @@ public: // ASSERT: both input & output capabilities will not be used together } int is_open() { return opened; } - gzstreambuf* open( const filesystem::path & name, int open_mode); + gzstreambuf* open( const std::filesystem::path & name, int open_mode); gzstreambuf* close(); ~gzstreambuf() { close(); } @@ -76,9 +76,9 @@ protected: gzstreambuf buf; public: gzstreambase() { init(&buf); } - gzstreambase( const filesystem::path & name, int open_mode); + gzstreambase( const std::filesystem::path & name, int open_mode); ~gzstreambase(); - void open( const filesystem::path & name, int open_mode); + void open( const std::filesystem::path & name, int open_mode); void close(); gzstreambuf* rdbuf() { return &buf; } }; @@ -92,10 +92,10 @@ public: class DLL_HEADER igzstream : public gzstreambase, public std::istream { public: igzstream() : std::istream( &buf) {} - igzstream( const filesystem::path & name, int open_mode = std::ios::in) + igzstream( const std::filesystem::path & name, int open_mode = std::ios::in) : gzstreambase( name, open_mode), std::istream( &buf) {} gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); } - void open( const filesystem::path & name, int open_mode = std::ios::in) { + void open( const std::filesystem::path & name, int open_mode = std::ios::in) { gzstreambase::open( name, open_mode); } }; @@ -103,10 +103,10 @@ public: class DLL_HEADER ogzstream : public gzstreambase, public std::ostream { public: ogzstream() : std::ostream( &buf) {} - ogzstream( const filesystem::path & name, int mode = std::ios::out) + ogzstream( const std::filesystem::path & name, int mode = std::ios::out) : gzstreambase( name, mode), std::ostream( &buf) {} gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); } - void open( const filesystem::path & name, int open_mode = std::ios::out) { + void open( const std::filesystem::path & name, int open_mode = std::ios::out) { gzstreambase::open( name, open_mode); } }; diff --git a/libsrc/general/myadt.hpp b/libsrc/general/myadt.hpp index 56f65ab2..1c26d02b 100644 --- a/libsrc/general/myadt.hpp +++ b/libsrc/general/myadt.hpp @@ -45,5 +45,4 @@ namespace netgen // #include "mpi_interface.hpp" #include "netgenout.hpp" - #endif diff --git a/libsrc/general/parthreads.hpp b/libsrc/general/parthreads.hpp index d7f42a4a..52b3208d 100644 --- a/libsrc/general/parthreads.hpp +++ b/libsrc/general/parthreads.hpp @@ -77,8 +77,8 @@ public: template void ParallelFor( int first, int next, const TFunc & f ) { - int nthreads = thread::hardware_concurrency(); - thread * threads = new thread[nthreads]; + int nthreads = std::thread::hardware_concurrency(); + std::thread * threads = new std::thread[nthreads]; for (int i=0; i); - typedef void (*NgTracer)(string, bool); // false .. start, true .. stop + typedef void (*NgTracer)(std::string, bool); // false .. start, true .. stop inline void DummyTaskManager (std::function func) { @@ -105,7 +105,7 @@ void ParallelFor( int first, int next, const TFunc & f ) func(1,2); } - inline void DummyTracer (string, bool) { ; } + inline void DummyTracer (std::string, bool) { ; } template inline void ParallelFor (NgTaskManager tm, size_t n, FUNC func) diff --git a/libsrc/general/template.hpp b/libsrc/general/template.hpp index ccb35ab7..5f2b41d7 100644 --- a/libsrc/general/template.hpp +++ b/libsrc/general/template.hpp @@ -16,7 +16,7 @@ namespace netgen templates, global types, defines and variables */ -DLL_HEADER extern const string netgen_version; + DLL_HEADER extern const std::string netgen_version; /// The following value may be adapted to the hardware ! #ifndef CLOCKS_PER_SEC diff --git a/libsrc/include/incopengl.hpp b/libsrc/include/incopengl.hpp index 1f42f12f..7b07cf6f 100644 --- a/libsrc/include/incopengl.hpp +++ b/libsrc/include/incopengl.hpp @@ -5,6 +5,7 @@ #include #include + # ifdef __APPLE__ #define GL_SILENCE_DEPRECATION #define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED diff --git a/libsrc/include/mystdlib.h b/libsrc/include/mystdlib.h index a538b6da..5b495edd 100644 --- a/libsrc/include/mystdlib.h +++ b/libsrc/include/mystdlib.h @@ -55,18 +55,23 @@ namespace metis { extern "C" { # ifndef NO_PARALLEL_THREADS # ifdef MSVC_EXPRESS # else -# include -# include +// # include +// # include # endif // MSVC_EXPRESS # endif # include # undef WIN32_LEAN_AND_MEAN -# include +// # include #else // Not using MC VC++ #endif -using namespace std; +// using namespace std; +namespace netgen +{ + using namespace std; +} + #endif diff --git a/libsrc/meshing/meshing.hpp b/libsrc/meshing/meshing.hpp index 48dc76f2..12129cbb 100644 --- a/libsrc/meshing/meshing.hpp +++ b/libsrc/meshing/meshing.hpp @@ -9,6 +9,12 @@ #include "../include/opti.hpp" +/*** Windows headers ***/ +#ifdef _MSC_VER +# define WIN32_LEAN_AND_MEAN +# include +# undef WIN32_LEAN_AND_MEAN +#endif namespace netgen { @@ -62,4 +68,6 @@ namespace netgen #include "paralleltop.hpp" + + #endif diff --git a/libsrc/stlgeom/stlpkg.cpp b/libsrc/stlgeom/stlpkg.cpp index 6ca94118..7dc7b3ab 100644 --- a/libsrc/stlgeom/stlpkg.cpp +++ b/libsrc/stlgeom/stlpkg.cpp @@ -1,4 +1,5 @@ #include + #include #include #include @@ -6,7 +7,11 @@ #include + #include + + + #include #include diff --git a/libsrc/visualization/visual.hpp b/libsrc/visualization/visual.hpp index 032838ca..83425fa4 100644 --- a/libsrc/visualization/visual.hpp +++ b/libsrc/visualization/visual.hpp @@ -13,13 +13,6 @@ Visualization */ -// #ifdef PARALLEL -// #define PARALLELGL -// #endif - - - - #include "visual_api.hpp" #include "../include/incopengl.hpp" diff --git a/libsrc/visualization/visualpkg.cpp b/libsrc/visualization/visualpkg.cpp index 11881159..21d4668e 100644 --- a/libsrc/visualization/visualpkg.cpp +++ b/libsrc/visualization/visualpkg.cpp @@ -1,6 +1,5 @@ #include // #include -#include #include @@ -8,7 +7,7 @@ #include #include - +#include // #include #include diff --git a/ng/gui.cpp b/ng/gui.cpp index 88927aad..8b702376 100644 --- a/ng/gui.cpp +++ b/ng/gui.cpp @@ -1,8 +1,13 @@ #include -#include #include +#include #include +using std::string; +using std::endl; +using std::cout; +using std::cerr; + namespace netgen { NGCORE_API_EXPORT Flags parameters; diff --git a/ng/ngappinit.cpp b/ng/ngappinit.cpp index 5fa8c248..92b05a6f 100644 --- a/ng/ngappinit.cpp +++ b/ng/ngappinit.cpp @@ -33,6 +33,11 @@ using netgen::verbose; using netgen::NgArray; using netgen::RegisterUserFormats; +using std::string; +using std::endl; +using std::cout; +using std::cerr; +using std::ofstream;