summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2012-01-13 13:38:40 +0100
committerDavid 'Digit' Turner <digit@google.com>2012-01-13 13:38:40 +0100
commit7913bc05bec230799aa70188b40ec7b231f5400f (patch)
treed5deaf653ad7608f7312172b00e572ffd8e1199d
parentdae26c6ac44e9c47cc60fcaa3d04c54d68d66760 (diff)
downloadsystem_core-7913bc05bec230799aa70188b40ec7b231f5400f.zip
system_core-7913bc05bec230799aa70188b40ec7b231f5400f.tar.gz
system_core-7913bc05bec230799aa70188b40ec7b231f5400f.tar.bz2
libcutils: Use proper private header to access C library's <time.h> extension
The strftime_tz() function is not a standard C library function and should not appear in <time.h>. Instead, it is being moved to <bionic_time.h>, a private header only available to platform libraries. Change-Id: I4dc18939b9380725dfaa20c9e417296363bc52f4
-rw-r--r--include/cutils/tztime.h10
-rw-r--r--libcutils/Android.mk9
2 files changed, 16 insertions, 3 deletions
diff --git a/include/cutils/tztime.h b/include/cutils/tztime.h
index cf103ca..36ac25d 100644
--- a/include/cutils/tztime.h
+++ b/include/cutils/tztime.h
@@ -26,8 +26,14 @@ extern "C" {
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 */
+#ifdef HAVE_ANDROID_OS
+
+/* the following is defined in the Bionic C library on Android, but the
+ * declarations are only available through a platform-private header
+ */
+#include <bionic_time.h>
+
+#else /* !HAVE_ANDROID_OS */
struct strftime_locale {
const char *mon[12]; /* short names */
diff --git a/libcutils/Android.mk b/libcutils/Android.mk
index effaae0..dcf859b 100644
--- a/libcutils/Android.mk
+++ b/libcutils/Android.mk
@@ -96,6 +96,12 @@ include $(BUILD_HOST_STATIC_LIBRARY)
# Shared and static library for target
# ========================================================
+
+# This is needed in LOCAL_C_INCLUDES to access the C library's private
+# header named <bionic_time.h>
+#
+libcutils_c_includes := bionic/libc/private
+
include $(CLEAR_VARS)
LOCAL_MODULE := libcutils
LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c android_reboot.c partition_utils.c uevent.c qtaguid.c klog.c
@@ -115,7 +121,7 @@ endif # !x86-atom
endif # !sh
endif # !arm
-LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_C_INCLUDES := $(libcutils_c_includes) $(KERNEL_HEADERS)
LOCAL_STATIC_LIBRARIES := liblog
LOCAL_CFLAGS += $(targetSmpFlag)
include $(BUILD_STATIC_LIBRARY)
@@ -125,6 +131,7 @@ LOCAL_MODULE := libcutils
LOCAL_WHOLE_STATIC_LIBRARIES := libcutils
LOCAL_SHARED_LIBRARIES := liblog
LOCAL_CFLAGS += $(targetSmpFlag)
+LOCAL_C_INCLUDES := $(libcutils_c_includes)
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)