[DEBUG] correction of the STDint in the android mode ==> not set the min/max

and correct the log system
This commit is contained in:
Edouard DUPIN 2013-05-29 21:31:08 +02:00
parent a2c5f8ac4e
commit 1c21a6f3d5
4 changed files with 30 additions and 8 deletions

View File

@ -66,7 +66,7 @@ etk::CCout& etk::operator <<(etk::CCout &os, const etk::logLevel_te obj)
os << ETK_BASH_COLOR_BOLD_RED;
#endif
#if defined(__TARGET_OS__Android)
m_levelAndroid = ANDROID_LOG_FATAL;
os.m_levelAndroid = ANDROID_LOG_FATAL;
#endif
os << "[C]";
break;
@ -75,7 +75,7 @@ etk::CCout& etk::operator <<(etk::CCout &os, const etk::logLevel_te obj)
os << ETK_BASH_COLOR_RED;
#endif
#if defined(__TARGET_OS__Android)
m_levelAndroid = ANDROID_LOG_ERROR;
os.m_levelAndroid = ANDROID_LOG_ERROR;
#endif
os << "[E]";
break;
@ -84,7 +84,7 @@ etk::CCout& etk::operator <<(etk::CCout &os, const etk::logLevel_te obj)
os << ETK_BASH_COLOR_MAGENTA;
#endif
#if defined(__TARGET_OS__Android)
m_levelAndroid = ANDROID_LOG_WARN;
os.m_levelAndroid = ANDROID_LOG_WARN;
#endif
os << "[W]";
break;
@ -93,7 +93,7 @@ etk::CCout& etk::operator <<(etk::CCout &os, const etk::logLevel_te obj)
os << ETK_BASH_COLOR_CYAN;
#endif
#if defined(__TARGET_OS__Android)
m_levelAndroid = ANDROID_LOG_INFO;
os.m_levelAndroid = ANDROID_LOG_INFO;
#endif
os << "[I]";
break;
@ -102,7 +102,7 @@ etk::CCout& etk::operator <<(etk::CCout &os, const etk::logLevel_te obj)
os << ETK_BASH_COLOR_YELLOW;
#endif
#if defined(__TARGET_OS__Android)
m_levelAndroid = ANDROID_LOG_DEBUG;
os.m_levelAndroid = ANDROID_LOG_DEBUG;
#endif
os << "[D]";
break;
@ -111,7 +111,7 @@ etk::CCout& etk::operator <<(etk::CCout &os, const etk::logLevel_te obj)
os << ETK_BASH_COLOR_WHITE;
#endif
#if defined(__TARGET_OS__Android)
m_levelAndroid = ANDROID_LOG_VERBOSE;
os.m_levelAndroid = ANDROID_LOG_VERBOSE;
#endif
os << "[V]";
break;
@ -142,7 +142,7 @@ etk::CCout::~CCout()
etk::CCout& etk::CCout::operator << (const etk::UniChar& t)
{
char output[5];
int32_t len = t.GetUtf8(output);
t.GetUtf8(output);
snprintf(tmp, MAX_LOG_SIZE_TMP, "%s", output);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;

View File

@ -24,10 +24,11 @@ namespace etk
private:
char m_tmpChar[MAX_LOG_SIZE+1];
char tmp[MAX_LOG_SIZE_TMP];
etk::Mutex m_mutex;
#if defined(__TARGET_OS__Android)
public:
int8_t m_levelAndroid; //!< specific level for Android
#endif
etk::Mutex m_mutex;
public:
CCout(void);
~CCout(void);

View File

@ -16,7 +16,26 @@
#include <assert.h>
// defien type : uintXX_t and intXX_t
#define __STDC_LIMIT_MACROS
// note in android include the macro of min max are overwitten
#include <stdint.h>
// in case of android error ...
#ifndef __STDINT_LIMITS
#define INT8_MIN (-128)
#define INT8_MAX (127)
#define UINT8_MAX (255U)
#define INT16_MIN (-32768)
#define INT16_MAX (32767)
#define UINT16_MAX (65535U)
#define INT32_MIN (-2147483647-1)
#define INT32_MAX (2147483647)
#define UINT32_MAX (4294967295U)
#define INT64_MIN (__INT64_C(-9223372036854775807)-1)
#define INT64_MAX (__INT64_C(9223372036854775807))
#define UINT64_MAX (__UINT64_C(18446744073709551615))
#endif
typedef enum {
ERR_NONE = 0, //!< No error, luckily everything went fine

View File

@ -61,6 +61,8 @@ def Create(target):
if target.name=="Windows":
None
elif target.name=="Android":
None
else:
myModule.AddExportflag_LD("-lpthread")