Merge "Silence warnings about using offsetof on near-POD structs." into master-skia

https://skia.googlesource.com/skia/+/24ad096

Change-Id: If7bd992905da096c98e415c3da88949ca4069d9d
diff --git a/Android.mk b/Android.mk
index 994cc37..95b9a52 100644
--- a/Android.mk
+++ b/Android.mk
@@ -54,6 +54,9 @@
 	-U_FORTIFY_SOURCE \
 	-D_FORTIFY_SOURCE=1
 
+LOCAL_CPPFLAGS := \
+	-Wno-invalid-offsetof
+
 LOCAL_SRC_FILES := \
 	src/core/SkAAClip.cpp \
 	src/core/SkAnnotation.cpp \
diff --git a/bench/Android.mk b/bench/Android.mk
index df18d25..c3525c6 100644
--- a/bench/Android.mk
+++ b/bench/Android.mk
@@ -13,6 +13,9 @@
 	-U_FORTIFY_SOURCE \
 	-D_FORTIFY_SOURCE=1
 
+LOCAL_CPPFLAGS := \
+	-Wno-invalid-offsetof
+
 LOCAL_SRC_FILES := \
 	ResultsWriter.cpp \
 	SkBenchLogger.cpp \
diff --git a/dm/Android.mk b/dm/Android.mk
index acbaaad..ed8a509 100644
--- a/dm/Android.mk
+++ b/dm/Android.mk
@@ -12,6 +12,9 @@
 	-U_FORTIFY_SOURCE \
 	-D_FORTIFY_SOURCE=1
 
+LOCAL_CPPFLAGS := \
+	-Wno-invalid-offsetof
+
 LOCAL_SRC_FILES := \
 	DM.cpp \
 	DMBenchTask.cpp \
diff --git a/gm/Android.mk b/gm/Android.mk
index 1c30571..d95d561 100644
--- a/gm/Android.mk
+++ b/gm/Android.mk
@@ -12,6 +12,9 @@
 	-U_FORTIFY_SOURCE \
 	-D_FORTIFY_SOURCE=1
 
+LOCAL_CPPFLAGS := \
+	-Wno-invalid-offsetof
+
 LOCAL_SRC_FILES := \
 	gm_expectations.cpp \
 	../tools/sk_tool_utils.cpp \
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index d1b7144..96c889f 100644
--- a/gyp/common_conditions.gypi
+++ b/gyp/common_conditions.gypi
@@ -175,6 +175,7 @@
         'cflags_cc': [
           '-fno-rtti',
           '-Wnon-virtual-dtor',
+          '-Wno-invalid-offsetof',  # GCC <4.6 is old-school strict about what is POD.
         ],
         'conditions': [
           [ 'skia_android_framework==0', {
diff --git a/tests/Android.mk b/tests/Android.mk
index 290e65b..07df550 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -12,6 +12,9 @@
 	-U_FORTIFY_SOURCE \
 	-D_FORTIFY_SOURCE=1
 
+LOCAL_CPPFLAGS := \
+	-Wno-invalid-offsetof
+
 LOCAL_SRC_FILES := \
 	skia_test.cpp \
 	PathOpsAngleTest.cpp \