summaryrefslogtreecommitdiffstats
path: root/libs/utils/String8.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/utils/String8.cpp')
-rw-r--r--libs/utils/String8.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/utils/String8.cpp b/libs/utils/String8.cpp
index 3a34838..636cd83 100644
--- a/libs/utils/String8.cpp
+++ b/libs/utils/String8.cpp
@@ -136,10 +136,11 @@ static inline char* getEmptyString()
void initialize_string8()
{
-#ifdef LIBUTILS_NATIVE
- // Bite me, Darwin!
- gDarwinIsReallyAnnoying = gDarwinCantLoadAllObjects;
-#endif
+ // HACK: This dummy dependency forces linking libutils Static.cpp,
+ // which is needed to initialize String8/String16 classes.
+ // These variables are named for Darwin, but are needed elsewhere too,
+ // including static linking on any platform.
+ gDarwinIsReallyAnnoying = gDarwinCantLoadAllObjects;
SharedBuffer* buf = SharedBuffer::alloc(1);
char* str = (char*)buf->data();