core: Fix build in ISO C++11 mode
Fix compatibility with ISO C++11 compilers
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Change-Id: I8f9aa775b5681d4d8c5202a1a1935acb4efa4171
diff --git a/include/cutils/jstring.h b/include/cutils/jstring.h
index ee0018f..bf72973 100644
--- a/include/cutils/jstring.h
+++ b/include/cutils/jstring.h
@@ -24,7 +24,9 @@
extern "C" {
#endif
+#if __cplusplus < 201103L && !defined(__GXX_EXPERIMENTAL_CXX0X__)
typedef uint16_t char16_t;
+#endif
extern char * strndup16to8 (const char16_t* s, size_t n);
extern size_t strnlen16to8 (const char16_t* s, size_t n);
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp
index d3b5ed0..a70b6f2 100644
--- a/logcat/logcat.cpp
+++ b/logcat/logcat.cpp
@@ -659,14 +659,14 @@
}
if (!devices) {
- devices = new log_device_t(strdup("/dev/"LOGGER_LOG_MAIN), false, 'm');
+ devices = new log_device_t(strdup("/dev/" LOGGER_LOG_MAIN), false, 'm');
android::g_devCount = 1;
int accessmode =
(mode & O_RDONLY) ? R_OK : 0
| (mode & O_WRONLY) ? W_OK : 0;
// only add this if it's available
- if (0 == access("/dev/"LOGGER_LOG_SYSTEM, accessmode)) {
- devices->next = new log_device_t(strdup("/dev/"LOGGER_LOG_SYSTEM), false, 's');
+ if (0 == access("/dev/" LOGGER_LOG_SYSTEM, accessmode)) {
+ devices->next = new log_device_t(strdup("/dev/" LOGGER_LOG_SYSTEM), false, 's');
android::g_devCount++;
}
}