Fixed compilation on Visual C++.

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1351 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
lvezzaro 2011-01-30 14:14:28 +00:00
parent 35523c6cf4
commit a537d60571
11 changed files with 63 additions and 33 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8.00" Version="8,00"
Name="_sgpem" Name="_sgpem"
ProjectGUID="{8B810FB6-B138-45B0-AB81-228076316780}" ProjectGUID="{8B810FB6-B138-45B0-AB81-228076316780}"
RootNamespace="_sgpem" RootNamespace="_sgpem"
@ -68,7 +68,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="&#x0D;&#x0A;" AdditionalOptions="&#x0D;&#x0A;"
AdditionalDependencies="python24.lib backend.lib" AdditionalDependencies="python27.lib backend.lib"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(PYTHON_BASEPATH)\libs&quot;;&quot;$(SolutionDir)$(ConfigurationName)&quot;" AdditionalLibraryDirectories="&quot;$(PYTHON_BASEPATH)\libs&quot;;&quot;$(SolutionDir)$(ConfigurationName)&quot;"
GenerateDebugInformation="true" GenerateDebugInformation="true"
@ -98,6 +98,7 @@
/> />
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
CommandLine="move &quot;$(SolutionDir)$(ConfigurationName)\plugins\extras\pyloader\_sgpem.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\plugins\extras\pyloader\_sgpem.pyd&quot;"
/> />
</Configuration> </Configuration>
<Configuration <Configuration
@ -135,6 +136,7 @@
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
DisableSpecificWarnings="4275;4290;4661;4251;4297"
ForcedIncludeFiles="config.h" ForcedIncludeFiles="config.h"
/> />
<Tool <Tool
@ -148,7 +150,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="python24.lib backend.lib" AdditionalDependencies="python27.lib backend.lib"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(PYTHON_BASEPATH)\libs&quot;;&quot;$(SolutionDir)$(ConfigurationName)&quot;" AdditionalLibraryDirectories="&quot;$(PYTHON_BASEPATH)\libs&quot;;&quot;$(SolutionDir)$(ConfigurationName)&quot;"
GenerateDebugInformation="true" GenerateDebugInformation="true"
@ -180,6 +182,7 @@
/> />
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
CommandLine="move &quot;$(SolutionDir)$(ConfigurationName)\plugins\extras\pyloader\_sgpem.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\plugins\extras\pyloader\_sgpem.pyd&quot;"
/> />
</Configuration> </Configuration>
</Configurations> </Configurations>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8.00" Version="8,00"
Name="backend" Name="backend"
ProjectGUID="{4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}" ProjectGUID="{4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}"
RootNamespace="backend" RootNamespace="backend"
@ -127,7 +127,7 @@
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
DisableSpecificWarnings="4275;4290" DisableSpecificWarnings="4275;4290;4661;4251"
ForcedIncludeFiles="config.h" ForcedIncludeFiles="config.h"
/> />
<Tool <Tool

View File

@ -19,5 +19,5 @@
#endif #endif
#ifndef SHAREDIR #ifndef SHAREDIR
#define SHAREDIR ".\\plugins\\extras\\pyloader" #define SHAREDIR "\\plugins\\extras\\pyloader"
#endif #endif

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8.00" Version="8,00"
Name="pyloader" Name="pyloader"
ProjectGUID="{4054CAB1-7F6D-4FC7-884D-9B823F996679}" ProjectGUID="{4054CAB1-7F6D-4FC7-884D-9B823F996679}"
RootNamespace="pyloader" RootNamespace="pyloader"
@ -66,7 +66,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="backend.lib python24.lib" AdditionalDependencies="backend.lib python27.lib"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(PYTHON_BASEPATH)\libs&quot;;&quot;$(SolutionDir)$(ConfigurationName)&quot;" AdditionalLibraryDirectories="&quot;$(PYTHON_BASEPATH)\libs&quot;;&quot;$(SolutionDir)$(ConfigurationName)&quot;"
GenerateDebugInformation="true" GenerateDebugInformation="true"
@ -133,6 +133,7 @@
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
DisableSpecificWarnings="4275;4290;4661;4251"
ForcedIncludeFiles="config.h" ForcedIncludeFiles="config.h"
/> />
<Tool <Tool
@ -146,7 +147,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="backend.lib python24.lib" AdditionalDependencies="backend.lib python27.lib"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(PYTHON_BASEPATH)\libs&quot;;&quot;$(SolutionDir)$(ConfigurationName)&quot;" AdditionalLibraryDirectories="&quot;$(PYTHON_BASEPATH)\libs&quot;;&quot;$(SolutionDir)$(ConfigurationName)&quot;"
GenerateDebugInformation="true" GenerateDebugInformation="true"

View File

@ -29,24 +29,24 @@ Global
Release|Win32 = Release|Win32 Release|Win32 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Debug|Win32.ActiveCfg = Release|Win32 {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Debug|Win32.ActiveCfg = Debug|Win32
{4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Debug|Win32.Build.0 = Release|Win32 {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Debug|Win32.Build.0 = Debug|Win32
{4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Release|Win32.ActiveCfg = Release|Win32 {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Release|Win32.ActiveCfg = Release|Win32
{4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Release|Win32.Build.0 = Release|Win32 {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Release|Win32.Build.0 = Release|Win32
{4054CAB1-7F6D-4FC7-884D-9B823F996679}.Debug|Win32.ActiveCfg = Release|Win32 {4054CAB1-7F6D-4FC7-884D-9B823F996679}.Debug|Win32.ActiveCfg = Debug|Win32
{4054CAB1-7F6D-4FC7-884D-9B823F996679}.Debug|Win32.Build.0 = Release|Win32 {4054CAB1-7F6D-4FC7-884D-9B823F996679}.Debug|Win32.Build.0 = Debug|Win32
{4054CAB1-7F6D-4FC7-884D-9B823F996679}.Release|Win32.ActiveCfg = Release|Win32 {4054CAB1-7F6D-4FC7-884D-9B823F996679}.Release|Win32.ActiveCfg = Release|Win32
{4054CAB1-7F6D-4FC7-884D-9B823F996679}.Release|Win32.Build.0 = Release|Win32 {4054CAB1-7F6D-4FC7-884D-9B823F996679}.Release|Win32.Build.0 = Release|Win32
{7B477FAB-6E10-4347-9244-AC15D3A36670}.Debug|Win32.ActiveCfg = Release|Win32 {7B477FAB-6E10-4347-9244-AC15D3A36670}.Debug|Win32.ActiveCfg = Debug|Win32
{7B477FAB-6E10-4347-9244-AC15D3A36670}.Debug|Win32.Build.0 = Release|Win32 {7B477FAB-6E10-4347-9244-AC15D3A36670}.Debug|Win32.Build.0 = Debug|Win32
{7B477FAB-6E10-4347-9244-AC15D3A36670}.Release|Win32.ActiveCfg = Release|Win32 {7B477FAB-6E10-4347-9244-AC15D3A36670}.Release|Win32.ActiveCfg = Release|Win32
{7B477FAB-6E10-4347-9244-AC15D3A36670}.Release|Win32.Build.0 = Release|Win32 {7B477FAB-6E10-4347-9244-AC15D3A36670}.Release|Win32.Build.0 = Release|Win32
{C0BAA36E-0699-4885-8123-9906CC7845E5}.Debug|Win32.ActiveCfg = Release|Win32 {C0BAA36E-0699-4885-8123-9906CC7845E5}.Debug|Win32.ActiveCfg = Debug|Win32
{C0BAA36E-0699-4885-8123-9906CC7845E5}.Debug|Win32.Build.0 = Release|Win32 {C0BAA36E-0699-4885-8123-9906CC7845E5}.Debug|Win32.Build.0 = Debug|Win32
{C0BAA36E-0699-4885-8123-9906CC7845E5}.Release|Win32.ActiveCfg = Release|Win32 {C0BAA36E-0699-4885-8123-9906CC7845E5}.Release|Win32.ActiveCfg = Release|Win32
{C0BAA36E-0699-4885-8123-9906CC7845E5}.Release|Win32.Build.0 = Release|Win32 {C0BAA36E-0699-4885-8123-9906CC7845E5}.Release|Win32.Build.0 = Release|Win32
{8B810FB6-B138-45B0-AB81-228076316780}.Debug|Win32.ActiveCfg = Release|Win32 {8B810FB6-B138-45B0-AB81-228076316780}.Debug|Win32.ActiveCfg = Debug|Win32
{8B810FB6-B138-45B0-AB81-228076316780}.Debug|Win32.Build.0 = Release|Win32 {8B810FB6-B138-45B0-AB81-228076316780}.Debug|Win32.Build.0 = Debug|Win32
{8B810FB6-B138-45B0-AB81-228076316780}.Release|Win32.ActiveCfg = Release|Win32 {8B810FB6-B138-45B0-AB81-228076316780}.Release|Win32.ActiveCfg = Release|Win32
{8B810FB6-B138-45B0-AB81-228076316780}.Release|Win32.Build.0 = Release|Win32 {8B810FB6-B138-45B0-AB81-228076316780}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8.00" Version="8,00"
Name="sgpemv2" Name="sgpemv2"
ProjectGUID="{C0BAA36E-0699-4885-8123-9906CC7845E5}" ProjectGUID="{C0BAA36E-0699-4885-8123-9906CC7845E5}"
RootNamespace="sgpemv2" RootNamespace="sgpemv2"
@ -25,8 +25,8 @@
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
Description="Copy glade stuff" Description="Copy stuff"
CommandLine="copy &quot;$(SolutionDir)..\..\glade\*.glade&quot; &quot;$(SolutionDir)$(ConfigurationName)\glade&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)..\..\data\logo.png&quot; &quot;$(SolutionDir)$(ConfigurationName)\glade&quot;&#x0D;&#x0A;" CommandLine="copy &quot;$(SolutionDir)..\..\ui\*.ui&quot; &quot;$(SolutionDir)$(ConfigurationName)\ui&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)..\..\data\logo.png&quot; &quot;$(SolutionDir)$(ConfigurationName)\ui&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)..\..\src\testsuite\scheduling-wizards\environments&quot; &quot;$(SolutionDir)$(ConfigurationName)\examples&quot;&#x0D;&#x0A;"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
@ -43,8 +43,8 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\config&quot;;&quot;$(SolutionDir)..\..\src\backend&quot;;&quot;$(SolutionDir)..\..&quot;" AdditionalIncludeDirectories="&quot;$(SolutionDir)\config&quot;;&quot;$(SolutionDir)..\..\src\backend&quot;;&quot;$(SolutionDir)..\..&quot;;&quot;$(GTKMM_BASEPATH)\lib\cairomm-1.0\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;VISIBILITY_SUPPORT_HH" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;VISIBILITY_SUPPORT_HH;UIDIR=&quot;&quot;./ui&quot;&quot;;EXAMPLESDIR=&quot;&quot;./examples&quot;&quot;"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
@ -109,8 +109,8 @@
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
Description="Copy glade stuff" Description="Copy stuff"
CommandLine="copy &quot;$(SolutionDir)..\..\glade\*.glade&quot; &quot;$(SolutionDir)$(ConfigurationName)\glade&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)..\..\data\logo.png&quot; &quot;$(SolutionDir)$(ConfigurationName)\glade&quot;&#x0D;&#x0A;" CommandLine="copy &quot;$(SolutionDir)..\..\ui\*.ui&quot; &quot;$(SolutionDir)$(ConfigurationName)\ui&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)..\..\data\logo.png&quot; &quot;$(SolutionDir)$(ConfigurationName)\ui&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)..\..\src\testsuite\scheduling-wizards\environments&quot; &quot;$(SolutionDir)$(ConfigurationName)\examples&quot;&#x0D;&#x0A;"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
@ -126,13 +126,14 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)config&quot;;&quot;$(SolutionDir)..\..\src\backend&quot;;&quot;$(SolutionDir)..\..&quot;" AdditionalIncludeDirectories="&quot;$(SolutionDir)config&quot;;&quot;$(SolutionDir)..\..\src\backend&quot;;&quot;$(SolutionDir)..\..&quot;;&quot;$(GTKMM_BASEPATH)\lib\cairomm-1.0\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;VISIBILITY_SUPPORT_HH" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;VISIBILITY_SUPPORT_HH;UIDIR=&quot;&quot;./ui&quot;&quot;;EXAMPLESDIR=&quot;&quot;./examples&quot;&quot;"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
DisableSpecificWarnings="4275;4290;4661;4251;4267;4996;4181"
ForcedIncludeFiles="config.h" ForcedIncludeFiles="config.h"
/> />
<Tool <Tool

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8.00" Version="8,00"
Name="xmlsave" Name="xmlsave"
ProjectGUID="{7B477FAB-6E10-4347-9244-AC15D3A36670}" ProjectGUID="{7B477FAB-6E10-4347-9244-AC15D3A36670}"
RootNamespace="xmlsave" RootNamespace="xmlsave"
@ -129,6 +129,7 @@
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
DisableSpecificWarnings="4275;4290;4661;4251"
ForcedIncludeFiles="" ForcedIncludeFiles=""
/> />
<Tool <Tool

View File

@ -29,6 +29,10 @@
#include <glibmm/fileutils.h> #include <glibmm/fileutils.h>
#include <glibmm/pattern.h> #include <glibmm/pattern.h>
#ifdef _MSC_VER
#include <glibmm/miscutils.h>
#endif
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <functional> #include <functional>
@ -71,11 +75,24 @@ PythonCPUPolicyManager::PythonCPUPolicyManager()
GlobalPreferences& prefs = GlobalPreferences::get_instance(); GlobalPreferences& prefs = GlobalPreferences::get_instance();
#ifdef _MSC_VER
// Ensure relocation is possible on WIN32, relative paths don't appear
// to work anymore
Glib::ustring wdir = Glib::get_current_dir();
#endif
Glib::ustring importdirs = "import sys; sys.path[:0] = [ "; Glib::ustring importdirs = "import sys; sys.path[:0] = [ ";
for_each(prefs.get_policy_dirs().begin(), for_each(prefs.get_policy_dirs().begin(),
prefs.get_policy_dirs().end(), prefs.get_policy_dirs().end(),
pol_dirs_concat(importdirs)); pol_dirs_concat(importdirs));
#ifdef _MSC_VER
// Ensure relocation is possible on WIN32, relative paths don't appear
// to work anymore
importdirs += Glib::ustring(" '") + wdir + SHAREDIR + "' ]\n";
#else
importdirs += " '" SHAREDIR "' ]\n"; importdirs += " '" SHAREDIR "' ]\n";
#endif
PyRun_SimpleString(importdirs.c_str()); PyRun_SimpleString(importdirs.c_str());

View File

@ -22,7 +22,7 @@
#ifndef DOWN_CAST_TCC #ifndef DOWN_CAST_TCC
#define DOWN_CAST_TCC 1 #define DOWN_CAST_TCC 1
#if not defined(NDEBUG) && not defined(_MSC_VER) #if !defined(NDEBUG) && !defined(_MSC_VER)
#include <sys/types.h> #include <sys/types.h>
#include <typeinfo> #include <typeinfo>
#include <iostream> #include <iostream>
@ -115,7 +115,7 @@ namespace sgpem
template<typename From> template<typename From>
inline To* operator()(From* obj) const inline To* operator()(From* obj) const
{ {
#if not defined(NDEBUG) && not defined(_MSC_VER) #if !defined(NDEBUG) && !defined(_MSC_VER)
To* check_ptr = dynamic_cast<To*>(obj); To* check_ptr = dynamic_cast<To*>(obj);
if(check_ptr == NULL) if(check_ptr == NULL)
{ {

View File

@ -128,7 +128,7 @@ ConfigurePolicyDialog::ConfigurePolicyDialog(const Glib::ustring& title,
// Add final buttons, and we're done. // Add final buttons, and we're done.
add_button(Stock::CANCEL, RESPONSE_CANCEL); add_button(Stock::CANCEL, RESPONSE_CANCEL);
HButtonBox& bbox = *get_action_area(); ButtonBox& bbox = *get_action_area();
Button& okay_bt = *manage(new Button(Stock::OK)); Button& okay_bt = *manage(new Button(Stock::OK));
okay_bt.set_flags(CAN_DEFAULT); okay_bt.set_flags(CAN_DEFAULT);
set_default(okay_bt); set_default(okay_bt);

View File

@ -213,11 +213,18 @@ SimulationController::run_simulation_adaptor()
} }
catch(const CPUPolicyException& cpe) catch(const CPUPolicyException& cpe)
{ {
#ifndef _MSC_VER
// Fatal error. We should never get here. // Fatal error. We should never get here.
// Won't compile on Visual C++, what an idiotic compiler. Apparently he can't symphatize with the way
// Glib::ustring::compose() is written...
std::cerr << Glib::ustring::compose( std::cerr << Glib::ustring::compose(
_(" [EE] Fatal error. Impossible to deactivate the policy in file %1:%2"), __FILE__, __LINE__) _(" [EE] Fatal error. Impossible to deactivate the policy in file %1:%2"), __FILE__, __LINE__)
<< std::endl << _(" [EE] ") << cpe.what() << std::endl; << std::endl << _(" [EE] ") << cpe.what() << std::endl;
; #else
// Fatal error. We should never get here.
std::cerr << _(" [EE] Fatal error. Impossible to deactivate the policy in file ") << __FILE__ << ":" << __LINE__
<< std::endl << _(" [EE] ") << cpe.what() << std::endl;
#endif
abort(); abort();
} }
} }