diff options
author | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2013-02-17 21:17:09 -0200 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2013-02-17 21:17:09 -0200 |
commit | d273d650f54b440c123e029370885bd2ac8fb553 (patch) | |
tree | 95a61131b190b5fda381019d11b22e8a3b561fe2 /pcr/spectrum/gcc47.patch | |
parent | c33469d8922906a81f87786084bf024b849ff877 (diff) | |
parent | 98a7e894d8347b242611c2cfd44bdb0f81576080 (diff) | |
download | abslibre-d273d650f54b440c123e029370885bd2ac8fb553.tar.gz abslibre-d273d650f54b440c123e029370885bd2ac8fb553.tar.bz2 abslibre-d273d650f54b440c123e029370885bd2ac8fb553.zip |
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'pcr/spectrum/gcc47.patch')
-rw-r--r-- | pcr/spectrum/gcc47.patch | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/pcr/spectrum/gcc47.patch b/pcr/spectrum/gcc47.patch new file mode 100644 index 000000000..82cc58677 --- /dev/null +++ b/pcr/spectrum/gcc47.patch @@ -0,0 +1,97 @@ +diff -rupN spectrum-1.4.8/src/configinterface.cpp spectrum-1.4.8_gcc47/src/configinterface.cpp +--- spectrum-1.4.8/src/configinterface.cpp 2011-06-11 15:17:44.000000000 +0200 ++++ spectrum-1.4.8_gcc47/src/configinterface.cpp 2012-04-14 18:27:14.000000000 +0200 +@@ -18,6 +18,7 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA + */ + ++#include <unistd.h> + #include "configinterface.h" + #include "sys/un.h" + #include "sys/socket.h" +diff -rupN spectrum-1.4.8/src/spectrum_util.cpp spectrum-1.4.8_gcc47/src/spectrum_util.cpp +--- spectrum-1.4.8/src/spectrum_util.cpp 2011-06-11 15:17:44.000000000 +0200 ++++ spectrum-1.4.8_gcc47/src/spectrum_util.cpp 2012-04-14 18:26:33.000000000 +0200 +@@ -28,6 +28,7 @@ + #include "protocols/abstractprotocol.h" + #include "transport.h" + #include <sys/param.h> ++#include <unistd.h> + #ifdef BSD + #include <sys/types.h> + #include <sys/sysctl.h> +diff -rupN spectrum-1.4.8/src/utf8/checked.h spectrum-1.4.8_gcc47/src/utf8/checked.h +--- spectrum-1.4.8/src/utf8/checked.h 2010-10-08 09:15:22.000000000 +0200 ++++ spectrum-1.4.8_gcc47/src/utf8/checked.h 2012-04-14 18:26:31.000000000 +0200 +@@ -65,6 +65,35 @@ namespace utf8 + + /// The library API - functions intended to be called by the users + ++ template <typename octet_iterator> ++ octet_iterator append(uint32_t cp, octet_iterator result) ++ { ++ if (!internal::is_code_point_valid(cp)) ++ throw invalid_code_point(cp); ++ ++ if (cp < 0x80) // one octet ++ *(result++) = static_cast<uint8_t>(cp); ++ else if (cp < 0x800) { // two octets ++ *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0); ++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); ++ } ++ else if (cp < 0x10000) { // three octets ++ *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0); ++ *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80); ++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); ++ } ++ else if (cp <= internal::CODE_POINT_MAX) { // four octets ++ *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0); ++ *(result++) = static_cast<uint8_t>(((cp >> 12)& 0x3f) | 0x80); ++ *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80); ++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); ++ } ++ else ++ throw invalid_code_point(cp); ++ ++ return result; ++ } ++ + template <typename octet_iterator, typename output_iterator> + output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement) + { +@@ -104,35 +133,6 @@ namespace utf8 + } + + template <typename octet_iterator> +- octet_iterator append(uint32_t cp, octet_iterator result) +- { +- if (!internal::is_code_point_valid(cp)) +- throw invalid_code_point(cp); +- +- if (cp < 0x80) // one octet +- *(result++) = static_cast<uint8_t>(cp); +- else if (cp < 0x800) { // two octets +- *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0); +- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); +- } +- else if (cp < 0x10000) { // three octets +- *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0); +- *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80); +- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); +- } +- else if (cp <= internal::CODE_POINT_MAX) { // four octets +- *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0); +- *(result++) = static_cast<uint8_t>(((cp >> 12)& 0x3f) | 0x80); +- *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80); +- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); +- } +- else +- throw invalid_code_point(cp); +- +- return result; +- } +- +- template <typename octet_iterator> + uint32_t next(octet_iterator& it, octet_iterator end) + { + uint32_t cp = 0; |