From acb12fa529115c82e52d0b1b8f13c0768a913911 Mon Sep 17 00:00:00 2001 From: barate Date: Mon, 21 Nov 2011 14:41:15 +0000 Subject: [PATCH] Fix compilation errors on Windows --- src/Core/Batch_Versatile.hxx | 8 ++++++-- src/Local/Batch_BatchManager_Local.cxx | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Core/Batch_Versatile.hxx b/src/Core/Batch_Versatile.hxx index 96b4b60..1b628e2 100644 --- a/src/Core/Batch_Versatile.hxx +++ b/src/Core/Batch_Versatile.hxx @@ -43,6 +43,7 @@ #include "Batch_CoupleType.hxx" #include "Batch_TypeMismatchException.hxx" #include "Batch_ListIsFullException.hxx" +#include "Batch_RunTimeException.hxx" namespace Batch { @@ -57,6 +58,10 @@ namespace Batch { Versatile(DiscriminatorType discriminator, size_type maxsize, std::string name); Versatile(const Versatile & V); + // Use of default constructor is forbidden but we cannot declare it private because + // compilation fails with VC8 on Windows + Versatile() { throw RunTimeException("Forbidden constructor"); } + // Destructor virtual ~Versatile(); @@ -104,8 +109,7 @@ namespace Batch { private: - // Forbid the use of default constructor and affectation operator - Versatile() {} + // Forbid the use of affectation operator void operator= (const Versatile & V) {} }; diff --git a/src/Local/Batch_BatchManager_Local.cxx b/src/Local/Batch_BatchManager_Local.cxx index c7d3f60..e33cb65 100644 --- a/src/Local/Batch_BatchManager_Local.cxx +++ b/src/Local/Batch_BatchManager_Local.cxx @@ -549,7 +549,7 @@ namespace Batch { while (1) { #ifdef WIN32 DWORD exitCode; - BOOL res = GetExitCodeProcess(child, &exitCode); + GetExitCodeProcess(child, &exitCode); if (exitCode != STILL_ACTIVE) { UNDER_LOCK( cout << "Father sees his child is DONE: exit code = " << exitCode << endl ); break; @@ -881,7 +881,7 @@ namespace Batch { char * buffer = strdup(comstr.c_str()); // launch the new process - BOOL res = CreateProcess(NULL, buffer, NULL, NULL, FALSE, + bool res = CreateProcess(NULL, buffer, NULL, NULL, FALSE, CREATE_NO_WINDOW, chNewEnv, NULL, &si, &pi); if (buffer) free(buffer); -- 2.39.2