Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix rstudio Desktop compilation with GCC 4.7 #14

Merged
merged 1 commit into from

2 participants

@JanMarvin

Fixes according to http://gcc.gnu.org/gcc-4.7/porting_to.html
Might break every other compiler :)

@jjallaire
Owner

Hi there, thanks for the request. 2 things:

1) I can't see what the actual change is to StringUtils.hpp -- definitely could be missing something but it looks like the utf8 functions were just moved rather than modified. If it is just a move if you could remove that file from the changelist that would be great.

2) To take a pull request we need either an individual or corporate contributor agreement (see: https://github.com/rstudio/rstudio/downloads). If you could send one of those we can pull the change (totally understand if this is a nuisance and you don't want to bother with it for a small change -- if you do this one then the next one will be easy :-)

Thanks,

J.J.

@JanMarvin

Hi,

To:
1) Function utf8Advance needs to be declared before its first use. Therefore it was moved. See the link above (section "Name lookup changes").

2) You have mail.

Have a nice day,
Marvin

Edit: woops :)

@jjallaire jjallaire merged commit 185292b into rstudio:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 15, 2012
  1. Fix Desktop compilation for GCC 4.7

    Jan Marvin Garbuszus authored
This page is out of date. Refresh to see the latest.
View
61 src/cpp/core/include/core/StringUtils.hpp
@@ -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,
View
1  src/cpp/core/include/core/system/PosixUser.hpp
@@ -15,6 +15,7 @@
#define CORE_SYSTEM_POSIX_USER_HPP
#include <string>
+#include <unistd.h>
namespace core {
class Error;
View
1  src/cpp/desktop/3rdparty/qtsingleapplication/qtlocalpeer.cpp
@@ -48,6 +48,7 @@
#include "qtlocalpeer.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QTime>
+#include <unistd.h>
#if defined(Q_OS_WIN)
#include <QtCore/QLibrary>
Something went wrong with that request. Please try again.