summaryrefslogtreecommitdiff
path: root/shared/system_func.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:11:56 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:11:56 +0200
commit98ecf620f7de377dc8ae9ad7fbd1e3b24477e138 (patch)
treefaadc6d8822c20cd3bc6f50b2a98e6c580585949 /shared/system_func.cpp
parent3.16 (diff)
downloadFreeFileSync-98ecf620f7de377dc8ae9ad7fbd1e3b24477e138.tar.gz
FreeFileSync-98ecf620f7de377dc8ae9ad7fbd1e3b24477e138.tar.bz2
FreeFileSync-98ecf620f7de377dc8ae9ad7fbd1e3b24477e138.zip
3.17
Diffstat (limited to 'shared/system_func.cpp')
-rw-r--r--shared/system_func.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/shared/system_func.cpp b/shared/system_func.cpp
deleted file mode 100644
index 430451e5..00000000
--- a/shared/system_func.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// **************************************************************************
-// * This file is part of the FreeFileSync project. It is distributed under *
-// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *
-// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) *
-// **************************************************************************
-//
-#include "system_func.h"
-
-#ifdef FFS_WIN
-#include <wx/msw/wrapwin.h> //includes "windows.h"
-
-#elif defined FFS_LINUX
-#include <cstring>
-#include <cerrno>
-#endif
-
-
-
-#ifdef FFS_WIN
-wxString ffs3::getLastErrorFormatted(unsigned long lastError) //try to get additional Windows error information
-{
- //determine error code if none was specified
- if (lastError == 0)
- lastError = ::GetLastError();
-
- wxString output = wxString(wxT("Windows Error Code ")) + wxString::Format(wxT("%u"), lastError);
-
- LPWSTR buffer = NULL;
- if (::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_MAX_WIDTH_MASK |
- FORMAT_MESSAGE_IGNORE_INSERTS | //important: without this flag ::FormatMessage() will fail if message contains placeholders
- FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, lastError, 0, reinterpret_cast<LPWSTR>(&buffer), 0, NULL) != 0)
- {
- if (buffer) //just to be sure
- {
- output += wxString(wxT(": ")) + buffer;
- ::LocalFree(buffer);
- }
- }
- ::SetLastError(lastError); //restore last error
-
- return output;
-}
-
-#elif defined FFS_LINUX
-wxString ffs3::getLastErrorFormatted(int lastError) //try to get additional Linux error information
-{
- //determine error code if none was specified
- if (lastError == 0)
- lastError = errno; //don't use "::", errno is a macro!
-
- wxString output = wxString(wxT("Linux Error Code ")) + wxString::Format(wxT("%i"), lastError);
- output += wxString(wxT(": ")) + wxString::FromUTF8(::strerror(lastError));
-
- errno = lastError; //restore errno
- return output;
-}
-#endif
bgstack15