summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/qt/platform.gyp2
-rw-r--r--platform/qt/scripts/configure.sh8
-rw-r--r--platform/qt/src/string_stdlib.cpp24
3 files changed, 30 insertions, 4 deletions
diff --git a/platform/qt/platform.gyp b/platform/qt/platform.gyp
index 880e366532..b948898e2a 100644
--- a/platform/qt/platform.gyp
+++ b/platform/qt/platform.gyp
@@ -46,7 +46,6 @@
'../default/mbgl/storage/offline_download.cpp',
'../default/online_file_source.cpp',
'../default/sqlite3.cpp',
- '../default/string_stdlib.cpp',
'include/qmapbox.hpp',
'include/qmapboxgl.hpp',
'include/qquickmapboxgl.hpp',
@@ -66,6 +65,7 @@
'src/qquickmapboxglrenderer.hpp',
'src/run_loop.cpp',
'src/run_loop_impl.hpp',
+ 'src/string_stdlib.cpp',
'src/timer.cpp',
'src/timer_impl.hpp',
],
diff --git a/platform/qt/scripts/configure.sh b/platform/qt/scripts/configure.sh
index 42541032c0..be809708ba 100644
--- a/platform/qt/scripts/configure.sh
+++ b/platform/qt/scripts/configure.sh
@@ -10,7 +10,6 @@ GEOJSON_VERSION=0.1.4${CXX11ABI:-}
GEOJSONVT_VERSION=6.1.0
GTEST_VERSION=1.7.0${CXX11ABI:-}
LIBJPEG_TURBO_VERSION=1.4.2
-NUNICODE_VERSION=1.6
PIXELMATCH_VERSION=0.9.0
RAPIDJSON_VERSION=1.0.2
SQLITE_VERSION=3.9.1
@@ -20,12 +19,15 @@ WEBP_VERSION=0.5.0
EARCUT_VERSION=0.11
function print_default_flags {
- CONFIG+=" 'cflags': $(quote_flags -fvisibility=hidden),"$LN
+ CONFIG+=" 'cflags': $(quote_flags -fvisibility=hidden -D__QT__),"$LN
}
if [ "$MASON_PLATFORM" == "osx" ]; then
+ # XXX: Argh, adding the __QT__ flag here because GYP for OSX does
+ # not respect the `cflags` variable above and we need it to reach
+ # the utests somehow. Gonna be fixed properly when we move to CMake.
function print_opengl_flags {
- CONFIG+=" 'opengl_cflags%': [],"$LN
+ CONFIG+=" 'opengl_cflags%': ['-D__QT__'],"$LN
CONFIG+=" 'opengl_ldflags%': ['-framework OpenGL', '-framework CoreFoundation'],"$LN
}
else
diff --git a/platform/qt/src/string_stdlib.cpp b/platform/qt/src/string_stdlib.cpp
new file mode 100644
index 0000000000..c4adecea06
--- /dev/null
+++ b/platform/qt/src/string_stdlib.cpp
@@ -0,0 +1,24 @@
+#include <mbgl/platform/platform.hpp>
+
+#include <QByteArray>
+#include <QString>
+
+#include <string>
+
+namespace mbgl {
+namespace platform {
+
+std::string uppercase(const std::string& str) {
+ auto upper = QString::fromUtf8(str.c_str()).toUpper().toUtf8();
+
+ return std::string(upper.constData(), upper.size());
+}
+
+std::string lowercase(const std::string& str) {
+ auto lower = QString::fromUtf8(str.c_str()).toLower().toUtf8();
+
+ return std::string(lower.constData(), lower.size());
+}
+
+} // namespace platform
+} // namespace mbgl