Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix rstudio Desktop compilation with GCC 4.7 #14

Merged
merged 1 commit into from Apr 17, 2012
Jump to file or symbol
Failed to load files and symbols.
+33 −30
Split
@@ -58,36 +58,6 @@ T hashStable(const std::string& str)
return hash;
}
-std::string wideToUtf8(const std::wstring& value);
-std::wstring utf8ToWide(const std::string& value,
- const std::string& context = std::string());
-
-template <typename Iterator, typename InputIterator>
-Error utf8Clean(Iterator begin,
- InputIterator end,
- unsigned char replacementChar)
-{
- using namespace boost::system;
-
- if (replacementChar > 0x7F)
- return systemError(errc::invalid_argument,
- "Invalid UTF-8 replacement character",
- ERROR_LOCATION);
-
- Error error;
-
- while (begin != end)
- {
- error = utf8Advance(begin, 1, end, &begin);
- if (error)
- {
- *begin = replacementChar;
- }
- }
-
- return Success();
-}
-
// Moves the begin pointer the specified number of UTF8
// characters.
template <typename InputIterator>
@@ -139,6 +109,37 @@ Error utf8Advance(InputIterator begin,
*pResult = begin;
return Success();
}
+std::string wideToUtf8(const std::wstring& value);
+std::wstring utf8ToWide(const std::string& value,
+ const std::string& context = std::string());
+
+template <typename Iterator, typename InputIterator>
+Error utf8Clean(Iterator begin,
+ InputIterator end,
+ unsigned char replacementChar)
+
+{
+ using namespace boost::system;
+
+ if (replacementChar > 0x7F)
+ return systemError(errc::invalid_argument,
+ "Invalid UTF-8 replacement character",
+ ERROR_LOCATION);
+
+ Error error;
+
+ while (begin != end)
+ {
+ error = utf8Advance(begin, 1, end, &begin);
+ if (error)
+ {
+ *begin = replacementChar;
+ }
+ }
+
+ return Success();
+}
+
template <typename InputIterator>
Error utf8Distance(InputIterator begin,
@@ -15,6 +15,7 @@
#define CORE_SYSTEM_POSIX_USER_HPP
#include <string>
+#include <unistd.h>
namespace core {
class Error;
@@ -48,6 +48,7 @@
#include "qtlocalpeer.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QTime>
+#include <unistd.h>
#if defined(Q_OS_WIN)
#include <QtCore/QLibrary>