[Tizen] Replaced OMIM_OS_BADA with OMIM_OS_TIZEN

This commit is contained in:
Sergey Pisarchik 2014-04-08 17:11:29 +03:00 committed by Alex Zolotarev
parent 0dd2a2b05f
commit 241f79dab8
8 changed files with 29 additions and 44 deletions

View file

@ -7,7 +7,7 @@
#include <cassert>
#ifdef OMIM_OS_BADA
#ifdef OMIM_OS_TIZEN
#include <FBaseSys.h>
#endif
@ -15,7 +15,7 @@ namespace my
{
void OnAssertFailedDefault(SrcPoint const & srcPoint, string const & msg)
{
#ifdef OMIM_OS_BADA
#ifdef OMIM_OS_TIZEN
AppLog("ASSERT FAILED%s:%d:%s", srcPoint.FileName(), srcPoint.Line(), msg.c_str());
AppAssert(false);

View file

@ -1,8 +1,6 @@
#include "../std/target_os.hpp"
#if defined(OMIM_OS_BADA)
#include "condition_bada.cpp"
#elif defined(OMIM_OS_WINDOWS_NATIVE)
#if defined(OMIM_OS_WINDOWS_NATIVE)
#include "condition_windows_native.cpp"
#else
#include "condition_posix.cpp"

View file

@ -1,6 +1,6 @@
#include "../std/target_os.hpp"
#if !defined(OMIM_OS_BADA) && !defined(OMIM_OS_WINDOWS_NATIVE)
#if !defined(OMIM_OS_WINDOWS_NATIVE)
#include "condition.hpp"
#include "mutex.hpp"

View file

@ -4,9 +4,7 @@
#include "../std/target_os.hpp"
#if defined(OMIM_OS_BADA)
#include <FBaseRtThreadMutex.h>
#elif defined(OMIM_OS_WINDOWS_NATIVE)
#if defined(OMIM_OS_WINDOWS_NATIVE)
#include "../std/windows.hpp"
#else
#include <pthread.h>
@ -30,9 +28,7 @@ namespace threads
{
private:
#if defined(OMIM_OS_BADA)
Osp::Base::Runtime::Mutex m_Mutex;
#elif defined(OMIM_OS_WINDOWS_NATIVE)
#if defined(OMIM_OS_WINDOWS_NATIVE)
CRITICAL_SECTION m_Mutex;
#else
pthread_mutex_t m_Mutex;
@ -49,9 +45,7 @@ namespace threads
Mutex()
{
#if defined(OMIM_OS_BADA)
m_Mutex.Create();
#elif defined(OMIM_OS_WINDOWS_NATIVE)
#if defined(OMIM_OS_WINDOWS_NATIVE)
::InitializeCriticalSection(&m_Mutex);
#else
::pthread_mutex_init(&m_Mutex, 0);
@ -62,16 +56,14 @@ namespace threads
{
#if defined(OMIM_OS_WINDOWS_NATIVE)
::DeleteCriticalSection(&m_Mutex);
#elif !defined(OMIM_OS_BADA)
#else
::pthread_mutex_destroy(&m_Mutex);
#endif
}
void Lock()
{
#if defined(OMIM_OS_BADA)
m_Mutex.Acquire();
#elif defined(OMIM_OS_WINDOWS_NATIVE)
#if defined(OMIM_OS_WINDOWS_NATIVE)
::EnterCriticalSection(&m_Mutex);
#else
VERIFY(0 == ::pthread_mutex_lock(&m_Mutex), ());
@ -89,9 +81,7 @@ namespace threads
void Unlock()
{
#if defined(OMIM_OS_BADA)
m_Mutex.Release();
#elif defined(OMIM_OS_WINDOWS_NATIVE)
#if defined(OMIM_OS_WINDOWS_NATIVE)
::LeaveCriticalSection(&m_Mutex);
#else
VERIFY(0 == ::pthread_mutex_unlock(&m_Mutex), ());

View file

@ -1,8 +1,8 @@
#include "thread.hpp"
#include "assert.hpp"
#if defined(OMIM_OS_BADA)
#include <FBaseRtThreadThread.h>
#if defined(OMIM_OS_TIZEN)
#include "../../tizen/inc/FBase.hpp"
#elif defined(OMIM_OS_WINDOWS_NATIVE)
#include "../std/windows.hpp"
#else
@ -17,20 +17,20 @@
namespace threads
{
#if defined(OMIM_OS_BADA)
/// BADA specific implementation
class ThreadImpl : public Osp::Base::Runtime::Thread
#if defined(OMIM_OS_TIZEN)
/// TIZEN specific implementation
class ThreadImpl : public Tizen::Base::Runtime::Thread
{
typedef Osp::Base::Runtime::Thread BaseT;
typedef Tizen::Base::Runtime::Thread BaseT;
IRoutine * m_pRoutine;
public:
/// Doesn't own pRoutine
ThreadImpl() : m_pRoutine(0)
{
result error = Construct(Osp::Base::Runtime::THREAD_TYPE_WORKER,
Osp::Base::Runtime::Thread::DEFAULT_STACK_SIZE,
Osp::Base::Runtime::THREAD_PRIORITY_MID);
result error = Construct(Tizen::Base::Runtime::THREAD_TYPE_WORKER,
Tizen::Base::Runtime::Thread::DEFAULT_STACK_SIZE,
Tizen::Base::Runtime::THREAD_PRIORITY_MID);
ASSERT_EQUAL(error, E_SUCCESS, ("Constructing thread error"));
}
@ -45,7 +45,7 @@ namespace threads
return BaseT::Join();
}
virtual Osp::Base::Object * Run()
virtual Tizen::Base::Object * Run()
{
m_pRoutine->Do();
return 0;

View file

@ -6,8 +6,8 @@
#define fseek64 _fseeki64
#define ftell64 _ftelli64
#elif defined(OMIM_OS_BADA)
STATIC_ASSERT(sizeof(_off64_t) == 8);
#elif defined(OMIM_OS_TIZEN)
//STATIC_ASSERT(sizeof(_off64_t) == 8);
#define fseek64 fseeko64
#define ftell64 ftello64

View file

@ -6,8 +6,8 @@
#include "../../std/bind.hpp"
#ifdef OMIM_OS_BADA
#include <FBaseSys.h>
#ifdef OMIM_OS_TIZEN
#include <egl.h>
#endif
@ -148,9 +148,6 @@ namespace graphics
{
if (err)
{
#ifdef OMIM_OS_BADA
AppLog("%s", err);
#endif
LOG(LERROR, (err, srcPt.FileName(), srcPt.Line()));
}
}
@ -165,7 +162,7 @@ namespace graphics
// case GL_STACK_OVERFLOW: return "GL_STACK_OVERFLOW"; //< not supported in OpenGL ES2.0
// case GL_STACK_UNDERFLOW: return "GL_STACK_UNDERFLOW"; //< not supported in OpenGL ES2.0
case GL_OUT_OF_MEMORY: return "GL_OUT_OF_MEMORY";
#ifdef OMIM_OS_BADA /* Errors / GetError return values */
#ifdef OMIM_OS_TIZEN /* Errors / GetError return values */
case EGL_SUCCESS : return 0;
case EGL_NOT_INITIALIZED : return "EGL_NOT_INITIALIZED";
case EGL_BAD_ACCESS : return "EGL_BAD_ACCESS";
@ -191,7 +188,7 @@ namespace graphics
LogError(Error2String(glGetError()), srcPt);
}
#ifdef OMIM_OS_BADA
#ifdef OMIM_OS_TIZEN
void CheckEGLError(my::SrcPoint const & srcPt)
{
LogError(Error2String(eglGetError()), srcPt);

View file

@ -11,9 +11,9 @@
#define GL_GLEXT_PROTOTYPES
#include "../../3party/GL/glext.h"
#elif defined(OMIM_OS_BADA)
#include <FGraphicsOpengl.h>
using namespace Osp::Graphics::Opengl;
#elif defined(OMIM_OS_TIZEN)
#include <FGraphicsOpengl2.h>
using namespace Tizen::Graphics::Opengl;
#define OMIM_GL_ES
#elif defined(OMIM_OS_MAC) || defined(OMIM_OS_IPHONE)