Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <deathbaba@gmail.com>2011-06-12 20:26:28 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:19:32 +0300
commit3496cc699022cc094767e9f0fd6c53594dedc018 (patch)
tree114f2d94ac97441b3131443533af75aecdd45e58
parent1b4276e965aaf381b674d94e8ab631b4355bbd07 (diff)
[android] Fixes for static lib toolchain support
-rw-r--r--base/memory_mapped_file.cpp6
-rw-r--r--coding/internal/file64_api.hpp10
-rw-r--r--map/map.pro2
-rw-r--r--omim.pro2
-rw-r--r--platform/platform.pro2
-rw-r--r--platform/preferred_languages.cpp6
-rw-r--r--std/iostream.hpp2
-rw-r--r--std/stdint.hpp2
-rw-r--r--std/string.hpp2
-rw-r--r--std/target_os.hpp6
-rw-r--r--yg/internal/opengl.hpp8
11 files changed, 38 insertions, 10 deletions
diff --git a/base/memory_mapped_file.cpp b/base/memory_mapped_file.cpp
index ef39135751..b3dd9201e8 100644
--- a/base/memory_mapped_file.cpp
+++ b/base/memory_mapped_file.cpp
@@ -4,7 +4,11 @@
#include <sys/mman.h>
#include <sys/errno.h>
#include <sys/stat.h>
- #include <sys/fcntl.h>
+ #ifdef OMIM_OS_ANDROID
+ #include <fcntl.h>
+ #else
+ #include <sys/fcntl.h>
+ #endif
#include <unistd.h>
#endif
diff --git a/coding/internal/file64_api.hpp b/coding/internal/file64_api.hpp
index 2172f97ba2..1eddd434aa 100644
--- a/coding/internal/file64_api.hpp
+++ b/coding/internal/file64_api.hpp
@@ -2,7 +2,7 @@
#include "../../base/base.hpp"
-#ifdef _MSC_VER
+#if defined(OMIM_OS_WINDOWS_NATIVE)
#define fseek64 _fseeki64
#define ftell64 _ftelli64
@@ -14,11 +14,17 @@
#define __LARGE64_FILES
typedef uint64_t _fpos64_t;
-#elif defined(OMIM_OS_WINDOWS)
+#elif defined(OMIM_OS_WINDOWS_MINGW)
STATIC_ASSERT(sizeof(off64_t) == 8);
#define fseek64 fseeko64
#define ftell64 ftello64
+#elif defined(OMIM_OS_ANDROID)
+ // For Android, off_t is 32bit, so big files are not supported
+ STATIC_ASSERT(sizeof(off_t) == 4);
+ #define fseek64 fseeko
+ #define ftell64 ftello
+
#else
STATIC_ASSERT(sizeof(off_t) == 8);
#define fseek64 fseeko
diff --git a/map/map.pro b/map/map.pro
index 0abc07b9ac..389c1bd6b1 100644
--- a/map/map.pro
+++ b/map/map.pro
@@ -40,7 +40,7 @@ SOURCES += \
benchmark_provider.cpp \
languages.cpp \
-!iphone*:!bada* {
+!iphone*:!bada*:!android* {
HEADERS += qgl_render_context.hpp
SOURCES += qgl_render_context.cpp
QT += opengl
diff --git a/omim.pro b/omim.pro
index fefab01030..8660590ecb 100644
--- a/omim.pro
+++ b/omim.pro
@@ -6,7 +6,7 @@ CONFIG += ordered
HEADERS += defines.hpp
# desktop projects
-!iphone*:!bada* {
+!iphone*:!bada*:!android* {
SUBDIRS = 3party \
base base/base_tests \
coding coding/coding_tests \
diff --git a/platform/platform.pro b/platform/platform.pro
index 201d86856a..d557e9ea96 100644
--- a/platform/platform.pro
+++ b/platform/platform.pro
@@ -11,7 +11,7 @@ include($$ROOT_DIR/common.pri)
QT *= core network
-!iphone* {
+!iphone*:!android* {
INCLUDEPATH += $$ROOT_DIR/3party/jansson/src
SOURCES += \
diff --git a/platform/preferred_languages.cpp b/platform/preferred_languages.cpp
index add03ab205..4f46fb07e1 100644
--- a/platform/preferred_languages.cpp
+++ b/platform/preferred_languages.cpp
@@ -19,6 +19,9 @@
#elif defined(OMIM_OS_LINUX)
#include "../std/stdlib.hpp"
+#elif defined(OMIM_OS_ANDROID)
+ /// @TODO
+
#else
#error "Define language preferences for your platform"
@@ -151,6 +154,9 @@ void SystemPreferredLanguages(vector<string> & languages)
else if ((p = getenv("LANG")))
languages.push_back(p);
+#elif defined(OMIM_OS_ANDROID)
+ /// @TODO
+
#else
#error "Define language preferences for your platform"
#endif
diff --git a/std/iostream.hpp b/std/iostream.hpp
index 1fe50b369f..7e56b9e9b2 100644
--- a/std/iostream.hpp
+++ b/std/iostream.hpp
@@ -16,9 +16,11 @@
using std::cin;
using std::cout;
using std::cerr;
+#ifndef OMIM_OS_ANDROID
using std::wcin;
using std::wcout;
using std::wcerr;
+#endif
#endif // OMIM_OS_BADA
using std::endl;
diff --git a/std/stdint.hpp b/std/stdint.hpp
index d679ba5e7f..7f444a3ceb 100644
--- a/std/stdint.hpp
+++ b/std/stdint.hpp
@@ -16,7 +16,7 @@
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
-#elif defined(OMIM_OS_BADA)
+#elif defined(OMIM_OS_BADA) || defined(OMIM_OS_ANDROID)
#include <stdint.h>
#else
diff --git a/std/string.hpp b/std/string.hpp
index 675fee5fe3..0cdd70eda6 100644
--- a/std/string.hpp
+++ b/std/string.hpp
@@ -12,7 +12,7 @@ using std::basic_string;
using std::string;
using std::getline;
-#ifdef OMIM_OS_BADA
+#if defined(OMIM_OS_BADA) || defined(OMIM_OS_ANDROID)
typedef std::basic_string<wchar_t> wstring;
#else
using std::wstring;
diff --git a/std/target_os.hpp b/std/target_os.hpp
index 8830773ade..0587a78f09 100644
--- a/std/target_os.hpp
+++ b/std/target_os.hpp
@@ -1,6 +1,10 @@
#pragma once
-#if defined(_BADA_SIMULATOR) || defined(_BADA_DEVICE)
+#if defined(ANDROID)
+ #define OMIM_OS_ANDROID
+ #define OMIM_OS_NAME "android"
+
+#elif defined(_BADA_SIMULATOR) || defined(_BADA_DEVICE)
#define OMIM_OS_BADA
#define OMIM_OS_NAME "bada"
diff --git a/yg/internal/opengl.hpp b/yg/internal/opengl.hpp
index 0603585bd8..9938cc747f 100644
--- a/yg/internal/opengl.hpp
+++ b/yg/internal/opengl.hpp
@@ -9,7 +9,7 @@
using namespace Osp::Graphics::Opengl;
#define OMIM_GL_ES
-#elif (defined(OMIM_OS_MAC) || defined(OMIM_OS_IPHONE))
+#elif defined(OMIM_OS_MAC) || defined(OMIM_OS_IPHONE)
#include <TargetConditionals.h>
#ifdef OMIM_OS_IPHONE
@@ -21,6 +21,12 @@
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#endif
+
+#elif defined(OMIM_OS_ANDROID)
+ #include <GLES/gl.h>
+ #include <GLES/glext.h>
+ #define OMIM_GL_ES
+
#else
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>