[toolchain upgrade] fixed build errors and warnings in gcc6x mode
[platform/core/location/maps-plugin-here.git] / inc / engine / common / HereMaps_global.h
1 /*
2  * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3  * This software, including documentation, is protected by copyright controlled by
4  * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5  * storing, adapting or translating, any or all of this material requires the prior
6  * written consent of HERE Global B.V. You may use this
7  * Software in accordance with the terms and conditions defined in the
8  * HERE Location Platform Services Terms and Conditions, available at
9  * http://developer.here.com/terms-conditions-base
10  *
11  * As an additional permission to the above, you may distribute Software,
12  * in object code format as part of an Application, according to, and subject to, terms and
13  * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14  * You may distribute such object code format Application under terms of your choice,
15  * provided that the header and source files of the Software have not been modified.
16  */
17
18 #ifndef HEREMAPS_GLOBAL_H
19 #define HEREMAPS_GLOBAL_H
20
21 #define TIZEN_MIGRATION
22
23 #ifdef TIZEN_MIGRATION
24 /* enhancement for updated HERE APIs */
25 #define TIZEN_CUSTOMIZATION
26
27 /* sub-features */
28 #define TIZEN_SUPPORT_LIMIT_RETRYING_FETCHING_TILES     /* limit the number of retrying when failed fetching tiles */
29 #define TIZEN_SUPPORT_TILE_FILE_CACHE
30 #define TIZEN_SUPPORT_POST_METHOD
31 #define TIZEN_SUPPORT_CRYPTO_LOCK                       /* mutex locking system for SSL */
32 #define TIZEN_SUPPORT_OPTIMIZATION_OF_REDRAWING
33
34 /* configuration */
35 #define TIZEN_CFG_CURL_TIMEOUT          120     /* seconds */
36 #define TIZEN_CFG_CURL_MULTITHREADS     8       /* the limit of multi-threads for CURL */
37
38 #define TIZEN_CFG_CPP11_UNIQUE_PTR
39
40 /* for debugging */
41 //#define TIZEN_PROFILING_CURL_TIME
42 //#define TIZEN_PROFILING_MEMLEAK
43 #endif
44
45
46
47 #ifdef TIZEN_MIGRATION
48 #include <string>
49
50 typedef unsigned long result;
51 typedef std::string String;
52 typedef std::string Uri;
53 typedef std::wstring WString;
54
55 typedef unsigned char byte;
56 #ifndef null
57 #define null    0
58 #endif // null
59 #endif
60
61
62
63 /*
64  * Note: DEBUG variable should be set from the outside.
65  * Currently done in CMAKE file
66  */
67
68 #define HERE_MAPS_BEGIN_NAMESPACE  namespace Here { namespace Maps {
69 #define HERE_MAPS_END_NAMESPACE    }}
70 #define HERE_MAPS_NAMESPACE_PREFIX Here::Maps
71
72 #define TIZEN_MAPS_BEGIN_NAMESPACE  namespace Tizen { namespace Maps {
73 #define TIZEN_MAPS_END_NAMESPACE    }}
74 #define TIZEN_MAPS_NAMESPACE_PREFIX Tizen::Maps
75
76 #include <memory>
77 #include <dlog.h>
78
79 //logging macro prototypes
80 #ifdef LOG_TAG
81 #undef LOG_TAG
82 #endif
83 #define LOG_TAG "HERE_PLUGIN"
84
85 #define HERE_MAPS_LOG_DBG_INFO(fmt,args...)  LOGD(fmt, ##args);
86 #define HERE_MAPS_LOG_ERROR(fmt,args...)     LOGE(fmt, ##args);
87 #define HERE_MAPS_LOG_WARNING(fmt,args...)   LOGW(fmt, ##args);
88
89 #define HERE_MAPS_RETURN_RESULT(cond,ret,fmt,args...)\
90         if (!cond) {\
91                 LOGE(fmt, ##args);\
92                 return ret;\
93         }
94
95 #define HERE_MAPS_TRY_CATCH(cond,catch,fmt,args...)\
96         if (!cond) {\
97                 LOGE(fmt, ##args);\
98                 catch;\
99                 goto CATCH;\
100         }
101
102 // Error severities
103 #define E_SUCCESS                       0
104 #define E_FAILURE                       -1
105 #define E_SYSTEM                        -2
106 #define E_INVALID_STATE                 -3
107 #define E_OUT_OF_MEMORY                 -4
108
109 #ifndef INFINITE
110 #define INFINITE    0xFFFFFFFF
111 #endif // INFINITE
112
113 //assertions
114 #include <assert.h>
115 #if DEBUG
116 #define HERE_MAPS_ASSERT(x) assert(x);
117 #else
118 #define HERE_MAPS_ASSERT(x)
119 #endif
120
121 typedef unsigned char Byte;
122 typedef unsigned int UInt;
123
124
125
126 #define HERE_MAPS_NO_COPY_NO_ASSIGN(ClassName) \
127   private:                                     \
128   ClassName(const ClassName&);                 \
129   ClassName& operator=(const ClassName&)
130
131
132 HERE_MAPS_BEGIN_NAMESPACE
133 extern void Stopwatch_Start(int aIndex);
134 extern void Stopwatch_Stop(int aIndex);
135 extern void Stopwatch_Show(int aIndex);
136 extern void Stopwatch_Reset(int aIndex);
137 HERE_MAPS_END_NAMESPACE
138
139 #undef VERSION
140 #define VERSION(a, b, c)        (((a) << 16) + ((b) << 8) + (c))
141
142 #endif // HEREMAPS_GLOBAL_H