Remove __LIBC_ABI_PUBLIC__.

We have much better control over visibility now, so we don't need to
pollute the headers with cruft.

Bug: http://b/24767418
Change-Id: I349f4c3bc30102477375ad9f80926e560c7c1d8b
diff --git a/libc/Android.bp b/libc/Android.bp
index 7309bd8..b1d37b4 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -143,7 +143,6 @@
     ],
 
     cflags: [
-        "-fvisibility=hidden",
         "-Wno-unused-parameter",
         // Don't use ridiculous amounts of stack.
         "-DALL_STATE",
@@ -747,7 +746,6 @@
     cflags: [
         "-Wno-sign-compare",
         "-Wno-uninitialized",
-        "-fvisibility=hidden",
         "-include openbsd-compat.h",
     ],
 
diff --git a/libc/dns/include/nsswitch.h b/libc/dns/include/nsswitch.h
index addbfc8..a0ae83b 100644
--- a/libc/dns/include/nsswitch.h
+++ b/libc/dns/include/nsswitch.h
@@ -202,7 +202,7 @@
 
 __BEGIN_DECLS
 int	nsdispatch(void *, const ns_dtab [], const char *,
-			const char *, const ns_src [], ...) __LIBC_ABI_PUBLIC__;
+			const char *, const ns_src [], ...);
 
 #ifdef _NS_PRIVATE
 int		 _nsdbtaddsrc(ns_dbt *, const ns_src *);
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index ffbce10..65b92a6 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -76,15 +76,13 @@
 
 __BIONIC_LEGACY_INLINE double atof(const char*);
 
-extern double strtod(const char*, char**) __LIBC_ABI_PUBLIC__;
-__BIONIC_LEGACY_INLINE float strtof(const char*, char**) __LIBC_ABI_PUBLIC__;
-extern long double strtold(const char*, char**) __LIBC_ABI_PUBLIC__ __INTRODUCED_IN(21);
+extern double strtod(const char*, char**);
+__BIONIC_LEGACY_INLINE float strtof(const char*, char**);
+extern long double strtold(const char*, char**) __INTRODUCED_IN(21);
 
-extern long double strtold_l(const char*, char**, locale_t) __LIBC_ABI_PUBLIC__ __INTRODUCED_IN(21);
-extern long long strtoll_l(const char*, char**, int, locale_t) __LIBC_ABI_PUBLIC__
-  __INTRODUCED_IN(21);
-extern unsigned long long strtoull_l(const char*, char**, int, locale_t) __LIBC_ABI_PUBLIC__
-  __INTRODUCED_IN(21);
+extern long double strtold_l(const char*, char**, locale_t) __INTRODUCED_IN(21);
+extern long long strtoll_l(const char*, char**, int, locale_t) __INTRODUCED_IN(21);
+extern unsigned long long strtoull_l(const char*, char**, int, locale_t) __INTRODUCED_IN(21);
 
 extern int atoi(const char*) __purefunc;
 extern long atol(const char*) __purefunc;
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index 26d0382..89061b6 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -281,16 +281,16 @@
 /* Used to tag non-static symbols that are private and never exposed by the shared library. */
 #define __LIBC_HIDDEN__ __attribute__((visibility("hidden")))
 
-/* Like __LIBC_HIDDEN__, but preserves binary compatibility for LP32. */
+/*
+ * Used to tag symbols that should be hidden for 64-bit,
+ * but visible to preserve binary compatibility for LP32.
+ */
 #ifdef __LP64__
-#define __LIBC32_LEGACY_PUBLIC__ __LIBC_HIDDEN__
+#define __LIBC32_LEGACY_PUBLIC__ __attribute__((visibility("hidden")))
 #else
-#define __LIBC32_LEGACY_PUBLIC__ __LIBC_ABI_PUBLIC__
+#define __LIBC32_LEGACY_PUBLIC__ __attribute__((visibility("default")))
 #endif
 
-/* Used to tag non-static symbols that are public and exposed by the shared library. */
-#define __LIBC_ABI_PUBLIC__ __attribute__((visibility ("default")))
-
 /* Used to rename functions so that the compiler emits a call to 'x' rather than the function this was applied to. */
 #define __RENAME(x) __asm__(#x)
 
diff --git a/libc/include/time.h b/libc/include/time.h
index ef4ac2f..ca4c708 100644
--- a/libc/include/time.h
+++ b/libc/include/time.h
@@ -37,9 +37,9 @@
 
 #define CLOCKS_PER_SEC 1000000
 
-extern char* tzname[] __LIBC_ABI_PUBLIC__;
-extern int daylight __LIBC_ABI_PUBLIC__;
-extern long int timezone __LIBC_ABI_PUBLIC__;
+extern char* tzname[];
+extern int daylight;
+extern long int timezone;
 
 struct sigevent;
 
@@ -59,49 +59,48 @@
 
 #define TM_ZONE tm_zone
 
-extern time_t time(time_t*) __LIBC_ABI_PUBLIC__;
-extern int nanosleep(const struct timespec*, struct timespec*) __LIBC_ABI_PUBLIC__;
+extern time_t time(time_t*);
+extern int nanosleep(const struct timespec*, struct timespec*);
 
-extern char* asctime(const struct tm*) __LIBC_ABI_PUBLIC__;
-extern char* asctime_r(const struct tm*, char*) __LIBC_ABI_PUBLIC__;
+extern char* asctime(const struct tm*);
+extern char* asctime_r(const struct tm*, char*);
 
-extern double difftime(time_t, time_t) __LIBC_ABI_PUBLIC__;
-extern time_t mktime(struct tm*) __LIBC_ABI_PUBLIC__;
+extern double difftime(time_t, time_t);
+extern time_t mktime(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* localtime(const time_t*);
+extern struct tm* localtime_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 struct tm* gmtime(const time_t*);
+extern struct tm* gmtime_r(const time_t*, 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 size_t strftime_l(char*, size_t, const char*, const struct tm*, locale_t) __LIBC_ABI_PUBLIC__
-  __INTRODUCED_IN(21);
+extern char* strptime(const char*, const char*, struct tm*);
+extern size_t strftime(char*, size_t, const char*, const struct tm*);
+extern size_t strftime_l(char*, size_t, const char*, const struct tm*, locale_t) __INTRODUCED_IN(21);
 
-extern char* ctime(const time_t*) __LIBC_ABI_PUBLIC__;
-extern char* ctime_r(const time_t*, char*) __LIBC_ABI_PUBLIC__;
+extern char* ctime(const time_t*);
+extern char* ctime_r(const time_t*, char*);
 
-extern void tzset(void) __LIBC_ABI_PUBLIC__;
+extern void tzset(void);
 
-extern clock_t clock(void) __LIBC_ABI_PUBLIC__;
+extern clock_t clock(void);
 
-extern int clock_getcpuclockid(pid_t, clockid_t*) __LIBC_ABI_PUBLIC__ __INTRODUCED_IN(23);
+extern int clock_getcpuclockid(pid_t, clockid_t*) __INTRODUCED_IN(23);
 
-extern int clock_getres(clockid_t, struct timespec*) __LIBC_ABI_PUBLIC__;
-extern int clock_gettime(clockid_t, struct timespec*) __LIBC_ABI_PUBLIC__;
-extern int clock_nanosleep(clockid_t, int, const struct timespec*, struct timespec*) __LIBC_ABI_PUBLIC__;
-extern int clock_settime(clockid_t, const struct timespec*) __LIBC_ABI_PUBLIC__;
+extern int clock_getres(clockid_t, struct timespec*);
+extern int clock_gettime(clockid_t, struct timespec*);
+extern int clock_nanosleep(clockid_t, int, const struct timespec*, struct timespec*);
+extern int clock_settime(clockid_t, const struct timespec*);
 
-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 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);
 
 /* Non-standard extensions that are in the BSDs and glibc. */
-extern time_t timelocal(struct tm*) __LIBC_ABI_PUBLIC__ __INTRODUCED_IN(12);
-extern time_t timegm(struct tm*) __LIBC_ABI_PUBLIC__ __INTRODUCED_IN(12);
+extern time_t timelocal(struct tm*) __INTRODUCED_IN(12);
+extern time_t timegm(struct tm*) __INTRODUCED_IN(12);
 
 __END_DECLS
 
diff --git a/libc/include/wchar.h b/libc/include/wchar.h
index 7a1fc07..fbea851 100644
--- a/libc/include/wchar.h
+++ b/libc/include/wchar.h
@@ -104,7 +104,7 @@
 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 *) __LIBC_ABI_PUBLIC__;
+extern size_t            wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *);
 extern size_t            wcslen(const wchar_t *);
 extern int               wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
 extern int wcsncasecmp_l(const wchar_t*, const wchar_t*, size_t, locale_t) __INTRODUCED_IN(23);