+LOCAL_CPPFLAGS += \
+ -D__STDC_CONSTANT_MACROS \
+ -D__STDC_FORMAT_MACROS \
+ -D__STDC_LIMIT_MACROS \
+ -Wno-error=non-virtual-dtor \
+ -Wno-non-virtual-dtor
+
+# mesa requires at least c99 compiler
+LOCAL_CONLYFLAGS += \
+ -std=c99
+
+# c11 timespec_get is part of bionic as well
+# https://android-review.googlesource.com/c/718518
+# This means releases from P and earlier won't need this
+ifeq ($(filter 5 6 7 8 9, $(MESA_ANDROID_MAJOR_VERSION)),)
+LOCAL_CFLAGS += -DHAVE_TIMESPEC_GET
+endif
+
+# Android's libc began supporting shm in Oreo
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo true),true)
+LOCAL_CFLAGS += -DHAVE_SYS_SHM_H
+endif
+