summaryrefslogtreecommitdiff
path: root/RealtimeSync
diff options
context:
space:
mode:
Diffstat (limited to 'RealtimeSync')
-rw-r--r--RealtimeSync/RealtimeSync.cbp4
-rw-r--r--RealtimeSync/makefile16
-rw-r--r--RealtimeSync/notify.cpp3
-rw-r--r--RealtimeSync/watcher.cpp11
4 files changed, 18 insertions, 16 deletions
diff --git a/RealtimeSync/RealtimeSync.cbp b/RealtimeSync/RealtimeSync.cbp
index 701e8c9c..4dd1addb 100644
--- a/RealtimeSync/RealtimeSync.cbp
+++ b/RealtimeSync/RealtimeSync.cbp
@@ -27,7 +27,7 @@
<Add library="libwxbase28u.a" />
<Add library="libwxpng.a" />
<Add library="libwxzlib.a" />
- <Add library="libboost_thread-mgw45-mt-s-1_44.a" />
+ <Add library="libboost_thread-mgw45-mt-s-1_45.a" />
<Add directory="C:\Programme\C++\wxWidgets\lib\gcc_lib" />
</Linker>
</Target>
@@ -51,7 +51,7 @@
<Add library="libwxbase28ud.a" />
<Add library="libwxpngd.a" />
<Add library="libwxzlibd.a" />
- <Add library="libboost_thread-mgw45-mt-sd-1_44.a" />
+ <Add library="libboost_thread-mgw45-mt-sd-1_45.a" />
<Add directory="C:\Program Files\C++\wxWidgets\lib\gcc_dll" />
</Linker>
</Target>
diff --git a/RealtimeSync/makefile b/RealtimeSync/makefile
index cf7aca36..e60ca3bf 100644
--- a/RealtimeSync/makefile
+++ b/RealtimeSync/makefile
@@ -1,10 +1,16 @@
APPNAME = RealtimeSync
-
prefix = /usr
BINDIR = $(DESTDIR)$(prefix)/bin
-FFS_CPPFLAGS=-Wall -pipe -DNDEBUG -DwxUSE_UNICODE `wx-config --cxxflags --debug=no --unicode=yes --static=yes` `pkg-config --cflags gtk+-2.0` -DFFS_LINUX -DTIXML_USE_STL -O3 -pthread
-LINKFLAGS=`wx-config --libs --debug=no --unicode=yes --static=yes` /usr/local/lib/libboost_thread.a -O3 -pthread
+#default build
+FFS_CPPFLAGS = -Wall -pipe -DNDEBUG -DwxUSE_UNICODE `wx-config --cxxflags --debug=no --unicode=yes` `pkg-config --cflags gtk+-2.0` -DFFS_LINUX -DTIXML_USE_STL -O3 -pthread
+LINKFLAGS = `wx-config --libs --debug=no --unicode=yes` -lboost_thread -O3 -pthread
+
+#static build used for precompiled release
+ifeq ($(BUILD),static)
+FFS_CPPFLAGS = -Wall -pipe -DNDEBUG -DwxUSE_UNICODE `wx-config --cxxflags --debug=no --unicode=yes --static=yes` `pkg-config --cflags gtk+-2.0` -DFFS_LINUX -DTIXML_USE_STL -O3 -pthread
+LINKFLAGS = `wx-config --libs --debug=no --unicode=yes --static=yes` /usr/local/lib/libboost_thread.a -O3 -pthread
+endif
FILE_LIST= #internal list of all *.cpp files needed for compilation
FILE_LIST+=application.cpp
@@ -46,9 +52,7 @@ all: RealtimeSync
init:
if [ ! -d OBJ ]; then mkdir OBJ; fi
-
#remove byte ordering mark: needed by Visual C++ but an error with GCC
-removeBOM: ../tools/remove_BOM.cpp
g++ -o OBJ/removeBOM ../tools/remove_BOM.cpp
./OBJ/removeBOM ../shared/localization.cpp ../shared/localization_no_BOM.cpp
@@ -56,7 +60,7 @@ removeBOM: ../tools/remove_BOM.cpp
#strip path information
g++ $(FFS_CPPFLAGS) -c $< -o OBJ/$(subst .cpp,.o,$(notdir $<))
-RealtimeSync: init removeBOM $(DEP_LIST)
+RealtimeSync: init $(DEP_LIST)
#respect linker order: wxWidgets libraries last
g++ -o ../BUILD/$(APPNAME) $(OBJECT_LIST) $(LINKFLAGS)
diff --git a/RealtimeSync/notify.cpp b/RealtimeSync/notify.cpp
index 599259e6..c87c15fc 100644
--- a/RealtimeSync/notify.cpp
+++ b/RealtimeSync/notify.cpp
@@ -198,7 +198,8 @@ public:
if (hNotfication == NULL)
{
const DWORD lastError = ::GetLastError();
- if (lastError != ERROR_CALL_NOT_IMPLEMENTED) //fail on SAMBA share: this shouldn't be a showstopper!
+ if (lastError != ERROR_CALL_NOT_IMPLEMENTED && //fail on SAMBA share: this shouldn't be a showstopper!
+ lastError != ERROR_SERVICE_SPECIFIC_ERROR) //neither should be fail for "Pogoplug" mapped network drives
throw ffs3::FileError(wxString(wxT("Could not register device removal notifications:")) + wxT("\n\n") + ffs3::getLastErrorFormatted(lastError));
}
else
diff --git a/RealtimeSync/watcher.cpp b/RealtimeSync/watcher.cpp
index e9793545..d03c98b8 100644
--- a/RealtimeSync/watcher.cpp
+++ b/RealtimeSync/watcher.cpp
@@ -96,18 +96,13 @@ public:
if (newExec - lastExec >= UPDATE_INTERVAL)
{
lastExec = newExec;
- allExisting_ = std::find_if(dirList.begin(), dirList.end(), notExisting) == dirList.end();
+ allExisting_ = std::find_if(dirList.begin(), dirList.end(), std::not1(std::ptr_fun(&ffs3::dirExists))) == dirList.end();
}
return allExisting_;
}
private:
- static bool notExisting(const Zstring& dirname)
- {
- return !ffs3::dirExists(dirname);
- }
-
mutable wxLongLong lastExec;
mutable bool allExisting_;
@@ -146,7 +141,9 @@ rts::WaitResult rts::waitForChanges(const std::vector<Zstring>& dirNames, WaitCa
if (rv == INVALID_HANDLE_VALUE)
{
- if (::GetLastError() == ERROR_FILE_NOT_FOUND) //no need to check this condition any earlier!
+ const DWORD lastError = ::GetLastError();
+ if ( lastError == ERROR_FILE_NOT_FOUND || //no need to check this condition any earlier!
+ lastError == ERROR_BAD_NETPATH) //
return CHANGE_DIR_MISSING;
const wxString errorMessage = wxString(_("Could not initialize directory monitoring:")) + wxT("\n\"") + zToWx(*i) + wxT("\"");
bgstack15