am 9d963b40: am d1bf3778: Merge "Build tzcode with hidden visibility."

* commit '9d963b406b9e2ac98a820b868c99be91a0f5842d':
  Build tzcode with hidden visibility.
This commit is contained in:
Elliott Hughes 2014-06-19 22:34:29 +00:00 committed by Android Git Automerger
commit dc042c64d1
6 changed files with 39 additions and 36 deletions

View file

@ -585,7 +585,10 @@ LOCAL_SRC_FILES := $(call all-c-files-under,tzcode)
# tzcode doesn't include wcsftime, so we use the OpenBSD one.
LOCAL_SRC_FILES += upstream-openbsd/lib/libc/time/wcsftime.c
LOCAL_CFLAGS := $(libc_common_cflags)
LOCAL_CFLAGS := $(libc_common_cflags) \
-fvisibility=hidden \
-Werror \
# Don't use ridiculous amounts of stack.
LOCAL_CFLAGS += -DALL_STATE
# Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
@ -597,7 +600,7 @@ LOCAL_CFLAGS += -DTZDIR=\"/system/usr/share/zoneinfo\"
# Include timezone and daylight globals.
LOCAL_CFLAGS += -DUSG_COMPAT=1
LOCAL_CFLAGS += -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU
LOCAL_CFLAGS += -Dlint -Werror
LOCAL_CFLAGS += -Dlint
LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags)

View file

@ -58,44 +58,43 @@ struct tm {
#define TM_ZONE tm_zone
extern time_t time(time_t*);
extern int nanosleep(const struct timespec*, struct timespec*);
extern time_t time(time_t*) __LIBC_ABI_PUBLIC__;
extern int nanosleep(const struct timespec*, struct timespec*) __LIBC_ABI_PUBLIC__;
extern char* asctime(const struct tm*);
extern char* asctime_r(const struct tm*, char*);
extern char* asctime(const struct tm*) __LIBC_ABI_PUBLIC__;
extern char* asctime_r(const struct tm*, char*) __LIBC_ABI_PUBLIC__;
extern double difftime(time_t, time_t);
extern time_t mktime(struct tm*);
extern double difftime(time_t, time_t) __LIBC_ABI_PUBLIC__;
extern time_t mktime(struct tm*) __LIBC_ABI_PUBLIC__;
extern struct tm* localtime(const time_t*);
extern struct tm* localtime_r(const time_t*, struct tm*);
extern struct tm* localtime(const time_t*) __LIBC_ABI_PUBLIC__;
extern struct tm* localtime_r(const time_t*, struct tm*) __LIBC_ABI_PUBLIC__;
extern struct tm* gmtime(const time_t*);
extern struct tm* gmtime_r(const time_t*, struct tm*);
extern struct tm* gmtime(const time_t*) __LIBC_ABI_PUBLIC__;
extern struct tm* gmtime_r(const time_t*, struct tm*) __LIBC_ABI_PUBLIC__;
extern char* strptime(const char*, const char*, struct tm*);
extern size_t strftime(char*, size_t, const char*, const struct tm*);
extern char* strptime(const char*, const char*, struct tm*) __LIBC_ABI_PUBLIC__;
extern size_t strftime(char*, size_t, const char*, const struct tm*) __LIBC_ABI_PUBLIC__;
extern char* ctime(const time_t*);
extern char* ctime_r(const time_t*, char*);
extern char* ctime(const time_t*) __LIBC_ABI_PUBLIC__;
extern char* ctime_r(const time_t*, char*) __LIBC_ABI_PUBLIC__;
extern void tzset(void);
extern void tzset(void) __LIBC_ABI_PUBLIC__;
extern clock_t clock(void);
extern clock_t clock(void) __LIBC_ABI_PUBLIC__;
extern int clock_getres(int, struct timespec*);
extern int clock_gettime(int, struct timespec*);
extern int clock_getres(int, struct timespec*) __LIBC_ABI_PUBLIC__;
extern int clock_gettime(int, struct timespec*) __LIBC_ABI_PUBLIC__;
extern int timer_create(int, struct sigevent*, timer_t*);
extern int timer_delete(timer_t);
extern int timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*);
extern int timer_gettime(timer_t, struct itimerspec*);
extern int timer_getoverrun(timer_t);
extern int timer_create(int, struct sigevent*, timer_t*) __LIBC_ABI_PUBLIC__;
extern int timer_delete(timer_t) __LIBC_ABI_PUBLIC__;
extern int timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*) __LIBC_ABI_PUBLIC__;
extern int timer_gettime(timer_t, struct itimerspec*) __LIBC_ABI_PUBLIC__;
extern int timer_getoverrun(timer_t) __LIBC_ABI_PUBLIC__;
extern time_t timelocal(struct tm*);
extern time_t timegm(struct tm*);
extern time_t time2posix(time_t);
extern time_t posix2time(time_t);
/* Non-standard extensions that are in the BSDs and glibc. */
extern time_t timelocal(struct tm*) __LIBC_ABI_PUBLIC__;
extern time_t timegm(struct tm*) __LIBC_ABI_PUBLIC__;
__END_DECLS

View file

@ -118,7 +118,7 @@ extern int wcscmp(const wchar_t *, const wchar_t *);
extern int wcscoll(const wchar_t *, const wchar_t *);
extern wchar_t *wcscpy(wchar_t *, const wchar_t *);
extern size_t wcscspn(const wchar_t *, const wchar_t *);
extern size_t wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *);
extern size_t wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *) __LIBC_ABI_PUBLIC__;
extern size_t wcslen(const wchar_t *);
extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
extern wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t);

View file

@ -52,10 +52,11 @@ struct strftime_locale {
/*
* Note: you should consider these extensions deprecated and use managed code or icu4c instead.
* We'd like to hide them but they're currently still used in frameworks code.
*/
extern size_t strftime_tz(char* s, size_t max, const char* format, const struct tm* tm, const struct strftime_locale* lc);
extern time_t mktime_tz(struct tm* const tmp, char const* tz);
extern void localtime_tz(const time_t* const timep, struct tm* tmp, const char* tz);
extern size_t strftime_tz(char*, size_t, const char*, const struct tm*, const struct strftime_locale*);
extern time_t mktime_tz(struct tm* const, char const*);
extern void localtime_tz(const time_t* const, struct tm*, const char*);
#endif /* _BIONIC_STRFTIME_TZ_DECLARED */

View file

@ -2293,7 +2293,7 @@ static int __bionic_tzload_cached(const char* name, struct state* const sp, cons
}
// Non-standard API: mktime(3) but with an explicit timezone parameter.
time_t mktime_tz(struct tm* const tmp, const char* tz) {
time_t __attribute__((visibility("default"))) mktime_tz(struct tm* const tmp, const char* tz) {
struct state* st = malloc(sizeof(*st));
time_t return_value;
@ -2310,7 +2310,7 @@ time_t mktime_tz(struct tm* const tmp, const char* tz) {
}
// Non-standard API: localtime(3) but with an explicit timezone parameter.
void localtime_tz(const time_t* const timep, struct tm* tmp, const char* tz) {
void __attribute__((visibility("default"))) localtime_tz(const time_t* const timep, struct tm* tmp, const char* tz) {
struct state* st = malloc(sizeof(*st));
if (st == NULL)

View file

@ -144,7 +144,7 @@ const struct tm * const t;
}
size_t
strftime_tz(s, maxsize, format, t, locale)
__attribute__((visibility("default"))) strftime_tz(s, maxsize, format, t, locale)
char * const s;
const size_t maxsize;
const char * const format;