Again, portability fixes

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1159 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-09-14 20:42:54 +00:00
parent 93359507ea
commit 503634d7c5
8 changed files with 36 additions and 7 deletions

View File

@ -23,6 +23,8 @@
#include <sgpemv2/string_utils.hh> #include <sgpemv2/string_utils.hh>
#include <sgpemv2/history.hh> #include <sgpemv2/history.hh>
#include <sgpemv2/resource.hh> #include <sgpemv2/resource.hh>
#include <sgpemv2/process.hh>
#include <sgpemv2/thread.hh>
using namespace sgpem; using namespace sgpem;

View File

@ -102,7 +102,7 @@ AddRequestDialog::AddRequestDialog(BaseObjectType* cobject, const RefPtr<Xml>& g
} }
Request* Request*
AddRequestDialog::run_add(Thread& owner) AddRequestDialog::run_add(sgpem::Thread& owner)
{ {
update_combo(); update_combo();

View File

@ -22,6 +22,10 @@
#include <cmath> #include <cmath>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
using namespace sgpem; using namespace sgpem;

View File

@ -301,7 +301,7 @@ PreferencesEditor::on_add_plugins_dir()
{ {
// I must get a string // I must get a string
Glib::ustring path; Glib::ustring path;
Gtk::FileChooserDialog* ask_path = new Gtk::FileChooserDialog::FileChooserDialog( Gtk::FileChooserDialog* ask_path = new Gtk::FileChooserDialog(
_("Select a directory to add"), _("Select a directory to add"),
Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER, path); Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER, path);
ask_path->add_button("gtk-cancel", Gtk::RESPONSE_CANCEL); ask_path->add_button("gtk-cancel", Gtk::RESPONSE_CANCEL);
@ -351,7 +351,7 @@ PreferencesEditor::on_add_policies_dir()
{ {
// I must get a string // I must get a string
Glib::ustring path; Glib::ustring path;
Gtk::FileChooserDialog* ask_path = new Gtk::FileChooserDialog::FileChooserDialog( Gtk::FileChooserDialog* ask_path = new Gtk::FileChooserDialog(
_("Select a directory to add"), _("Select a directory to add"),
Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER, path); Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER, path);
ask_path->add_button("gtk-cancel", Gtk::RESPONSE_CANCEL); ask_path->add_button("gtk-cancel", Gtk::RESPONSE_CANCEL);

View File

@ -42,7 +42,7 @@ namespace sgpem
public: public:
PreferencesEditor(const std::string& gladefile = GLADEDIR "/configure-dialog.glade"); explicit PreferencesEditor(const std::string& gladefile = GLADEDIR "/configure-dialog.glade");
void void

View File

@ -46,8 +46,13 @@
using namespace sgpem; using namespace sgpem;
using namespace std; using namespace std;
#ifndef M_SQRT1_2
#define M_SQRT1_2 0.70710678118654752440
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
HoltNode::HoltNode(Vec2 pt) HoltNode::HoltNode(Vec2 pt)

View File

@ -42,11 +42,17 @@ main(int argc, char* argv[])
using namespace std; using namespace std;
using Glib::ustring; using Glib::ustring;
#ifndef _MSC_VER
// Set up gettext support // Set up gettext support
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR); bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE); textdomain(PACKAGE);
#endif
#ifndef NDEBUG
try
{
#endif
// Set up Glib thread support // Set up Glib thread support
Glib::thread_init(); Glib::thread_init();
@ -54,5 +60,17 @@ main(int argc, char* argv[])
// filenames of documents to be opened // filenames of documents to be opened
parse_options(argc, argv); parse_options(argc, argv);
#ifndef NDEBUG
}
catch(const std::exception& exp)
{
std::cerr << exp.what() << std::endl;
}
catch(const Glib::Exception& gexp)
{
std::cerr << gexp.what() << std::endl;
}
#endif
return 0; return 0;
} }

View File

@ -84,7 +84,7 @@ TabularSimulationStatisticsWidget::update(const History& changed_history)
int num_procs=0, num_threads=0; int num_procs=0, num_threads=0;
vector<Process*> procs = Simulation::get_instance().get_history().get_environment_at(0).get_processes(); vector<Process*> procs = Simulation::get_instance().get_history().get_environment_at(0).get_processes();
num_procs = procs.size(); num_procs = procs.size();
for (uint i =0; i < procs.size(); i++) for (unsigned int i =0; i < procs.size(); i++)
num_threads += procs[i]->get_threads().size(); num_threads += procs[i]->get_threads().size();
if (num_procs == 0) if (num_procs == 0)