summaryrefslogtreecommitdiff
path: root/libchrome_tools/patch/lazy_instance.patch
diff options
context:
space:
mode:
Diffstat (limited to 'libchrome_tools/patch/lazy_instance.patch')
-rw-r--r--libchrome_tools/patch/lazy_instance.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/libchrome_tools/patch/lazy_instance.patch b/libchrome_tools/patch/lazy_instance.patch
new file mode 100644
index 0000000000..d144137a67
--- /dev/null
+++ b/libchrome_tools/patch/lazy_instance.patch
@@ -0,0 +1,18 @@
+# LAZY_INSTANCE_INITIALIZER will be embedded into the users of libchrome,
+# and could cause compile warning.
+
+--- a/base/lazy_instance.h
++++ b/base/lazy_instance.h
+@@ -48,7 +48,11 @@
+ // initialization, as base's LINKER_INITIALIZED requires a constructor and on
+ // some compilers (notably gcc 4.4) this still ends up needing runtime
+ // initialization.
+-#define LAZY_INSTANCE_INITIALIZER {0}
++#ifdef __clang__
++ #define LAZY_INSTANCE_INITIALIZER {}
++#else
++ #define LAZY_INSTANCE_INITIALIZER {0, 0}
++#endif
+
+ namespace base {
+