summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-10-24 03:05:08 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-24 03:05:08 -0700
commite1ab1f63a849e42fb3d11ca671030b83897b96d3 (patch)
tree4d145a956dc4777636ce03595c2cfa1019abc99e
parent3deac21344eb9e156d9bcbb2ea11f097ecd6b89a (diff)
parent4154342345fc67972570f59528233826cd397f1e (diff)
downloadexternal_chromium-e1ab1f63a849e42fb3d11ca671030b83897b96d3.zip
external_chromium-e1ab1f63a849e42fb3d11ca671030b83897b96d3.tar.gz
external_chromium-e1ab1f63a849e42fb3d11ca671030b83897b96d3.tar.bz2
am 41543423: Part of fix for bug 5455901 Export symbols from base
* commit '4154342345fc67972570f59528233826cd397f1e': Part of fix for bug 5455901 Export symbols from base
-rw-r--r--base/base_api.h9
-rw-r--r--base/logging.cc3
-rw-r--r--base/logging.h3
-rw-r--r--base/string16.h29
-rw-r--r--base/synchronization/lock_impl.h3
5 files changed, 36 insertions, 11 deletions
diff --git a/base/base_api.h b/base/base_api.h
index 83b4bdf..b101a4a 100644
--- a/base/base_api.h
+++ b/base/base_api.h
@@ -6,6 +6,13 @@
#define BASE_BASE_API_H_
#pragma once
+#ifdef ANDROID
+// Do not upstream, this will be added later upstream,
+// after this file is renamed to base_export.h. Not
+// cherry-picking that since the #define's also change
+#define BASE_API __attribute__((visibility("default")))
+#else
+
#if defined(WIN32) && defined(BASE_DLL)
#if defined(BASE_IMPLEMENTATION)
#define BASE_API __declspec(dllexport)
@@ -16,4 +23,6 @@
#define BASE_API
#endif
+#endif // ANDROID
+
#endif // BASE_BASE_API_H_
diff --git a/base/logging.cc b/base/logging.cc
index 430ae82..46bfd24 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -60,6 +60,9 @@ typedef pthread_mutex_t* MutexHandle;
namespace logging {
+#ifdef ANDROID
+BASE_API
+#endif
DcheckState g_dcheck_state = DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS;
VlogInfo* g_vlog_info = NULL;
diff --git a/base/logging.h b/base/logging.h
index 0e78e1a..1824bae 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -460,6 +460,9 @@ const LogSeverity LOG_0 = LOG_ERROR;
// be out of line, while the "Impl" code should be inline. Caller
// takes ownership of the returned string.
template<class t1, class t2>
+#ifdef ANDROID
+BASE_API
+#endif
std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) {
std::ostringstream ss;
ss << names << " (" << v1 << " vs. " << v2 << ")";
diff --git a/base/string16.h b/base/string16.h
index 25e980c..80e5ff7 100644
--- a/base/string16.h
+++ b/base/string16.h
@@ -30,6 +30,7 @@
#include <stdio.h>
#include <string>
+#include "base/base_api.h"
#include "base/basictypes.h"
#if defined(WCHAR_T_IS_UTF16)
@@ -46,14 +47,18 @@ namespace base {
// char16 versions of the functions required by string16_char_traits; these
// are based on the wide character functions of similar names ("w" or "wcs"
// instead of "c16").
-int c16memcmp(const char16* s1, const char16* s2, size_t n);
-size_t c16len(const char16* s);
-const char16* c16memchr(const char16* s, char16 c, size_t n);
-char16* c16memmove(char16* s1, const char16* s2, size_t n);
-char16* c16memcpy(char16* s1, const char16* s2, size_t n);
-char16* c16memset(char16* s, char16 c, size_t n);
-
-struct string16_char_traits {
+BASE_API int c16memcmp(const char16* s1, const char16* s2, size_t n);
+BASE_API size_t c16len(const char16* s);
+BASE_API const char16* c16memchr(const char16* s, char16 c, size_t n);
+BASE_API char16* c16memmove(char16* s1, const char16* s2, size_t n);
+BASE_API char16* c16memcpy(char16* s1, const char16* s2, size_t n);
+BASE_API char16* c16memset(char16* s, char16 c, size_t n);
+
+struct
+#ifdef ANDROID
+BASE_API
+#endif
+string16_char_traits {
typedef char16 char_type;
typedef int int_type;
@@ -163,12 +168,16 @@ struct string16_char_traits {
//
// TODO(mark): File this bug with Apple and update this note with a bug number.
-extern template class std::basic_string<char16, base::string16_char_traits>;
+extern template class
+#ifdef ANDROID
+BASE_API
+#endif
+std::basic_string<char16, base::string16_char_traits>;
typedef std::basic_string<char16, base::string16_char_traits> string16;
namespace base {
-extern std::ostream& operator<<(std::ostream& out, const string16& str);
+BASE_API extern std::ostream& operator<<(std::ostream& out, const string16& str);
}
#endif // WCHAR_T_IS_UTF32
diff --git a/base/synchronization/lock_impl.h b/base/synchronization/lock_impl.h
index 2994610..79bc147 100644
--- a/base/synchronization/lock_impl.h
+++ b/base/synchronization/lock_impl.h
@@ -14,6 +14,7 @@
#include <pthread.h>
#endif
+#include "base/base_api.h"
#include "base/basictypes.h"
namespace base {
@@ -22,7 +23,7 @@ namespace internal {
// This class implements the underlying platform-specific spin-lock mechanism
// used for the Lock class. Most users should not use LockImpl directly, but
// should instead use Lock.
-class LockImpl {
+class BASE_API LockImpl {
public:
#if defined(OS_WIN)
typedef CRITICAL_SECTION OSLockType;