From 3d288c971b7a30d270fa87d934e2c3b36e58b020 Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Mon, 18 Oct 2010 10:53:52 +0200 Subject: [PATCH] Fixed OSX/Unix compatability problem in OverwriteOutputFile There is a problem in gtk g_remove on Unix/OSX, as it just redefines g_remove to remove without giving a namespace. This may collide if your program defines a remove(char*) as well. --- rtgui/batchqueue.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index 554602adf..d6cd5ab32 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -351,12 +351,13 @@ Glib::ustring BatchQueue::autoCompleteFileName (const Glib::ustring& fileName, c int fileExists=Glib::file_test (fname, Glib::FILE_TEST_EXISTS); - /*if (inOverwriteMode && fileExists) { - if (g_remove(safe_locale_from_utf8(fname).c_str ()) == -1) + if (inOverwriteMode && fileExists) { + // do NOT use g_remove as it has compiler problems on Unix and OSX (GTK namespace problem) + if (::remove(safe_locale_from_utf8(fname).c_str ()) == -1) inOverwriteMode = false; // failed to delete- revert to old naming scheme else fileExists = false; // deleted now - }*/ + } if (!fileExists) { return fname;