Merge branch 'open_source' into google_internal
diff --git a/include/cutils/tztime.h b/include/cutils/tztime.h
index 9b3ece8..4af2ce4 100644
--- a/include/cutils/tztime.h
+++ b/include/cutils/tztime.h
@@ -17,6 +17,8 @@
#ifndef _CUTILS_TZTIME_H
#define _CUTILS_TZTIME_H
+#include <time.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -24,6 +26,9 @@
time_t mktime_tz(struct tm * const tmp, char const * tz);
void localtime_tz(const time_t * const timep, struct tm * tmp, const char* tz);
+#ifndef HAVE_ANDROID_OS
+/* the following is defined in <time.h> in Bionic */
+
struct strftime_locale {
const char *mon[12]; /* short names */
const char *month[12]; /* long names */
@@ -39,6 +44,8 @@
size_t strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale *locale);
+#endif /* !HAVE_ANDROID_OS */
+
#ifdef __cplusplus
}
#endif
diff --git a/libcutils/Android.mk b/libcutils/Android.mk
index a43f7e3..b6d806e 100644
--- a/libcutils/Android.mk
+++ b/libcutils/Android.mk
@@ -37,6 +37,9 @@
properties.c \
threads.c
+commonHostSources := \
+ ashmem-host.c
+
# some files must not be compiled when building against Mingw
# they correspond to features not used by our host development tools
# which are also hard or even impossible to port to native Win32
@@ -60,16 +63,18 @@
selector.c \
fdevent.c \
tztime.c \
- tzstrftime.c \
adb_networking.c \
- zygote.c
+ zygote.c
+
+ commonHostSources += \
+ tzstrftime.c
endif
# Static library for host
# ========================================================
LOCAL_MODULE := libcutils
-LOCAL_SRC_FILES := $(commonSources) ashmem-host.c
+LOCAL_SRC_FILES := $(commonSources) $(commonHostSources)
LOCAL_LDLIBS := -lpthread
LOCAL_STATIC_LIBRARIES := liblog
include $(BUILD_HOST_STATIC_LIBRARY)
@@ -81,7 +86,7 @@
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := libcutils
-LOCAL_SRC_FILES := $(commonSources) memory.c dlmalloc_stubs.c ashmem-host.c
+LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) memory.c dlmalloc_stubs.c
LOCAL_LDLIBS := -lpthread
LOCAL_SHARED_LIBRARIES := liblog
include $(BUILD_SHARED_LIBRARY)
diff --git a/toolbox/mkdosfs.c b/toolbox/mkdosfs.c
index 744aad1..66e720b 100644
--- a/toolbox/mkdosfs.c
+++ b/toolbox/mkdosfs.c
@@ -393,7 +393,7 @@
bpb.bsec = length / bpb.bps;
bpb.spt = bpb.bsec;
// use FAT32 for 2 gig or greater
- if (length >= 2 *1024 *1024 *1024) {
+ if (length >= 2LL *1024 *1024 *1024) {
fat = 32;
} else {
fat = 16;
diff --git a/toolbox/smd.c b/toolbox/smd.c
index 65ff994e..91e495c 100644
--- a/toolbox/smd.c
+++ b/toolbox/smd.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/vold/mmc.c b/vold/mmc.c
index 0f08964..fb61b2f 100644
--- a/vold/mmc.c
+++ b/vold/mmc.c
@@ -250,7 +250,7 @@
char filename[255];
char *uevent_buffer;
ssize_t sz;
- char *uevent_params[4];
+ char *uevent_params[5];
char tmp[255];
FILE *fp;
char line[255];