Remove libandroid_support's stdio.h.

We don't need this any more, and the decls in here are causing
inconsistent behavior across API levels.

Test: ./checkbuild.py
Bug: https://github.com/android-ndk/ndk/issues/734
Change-Id: Ie895cc41dc3fe809343bb22dbf63826dc6a7870f
diff --git a/sources/android/support/include/stdio.h b/sources/android/support/include/stdio.h
deleted file mode 100644
index 215f049..0000000
--- a/sources/android/support/include/stdio.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#pragma once
-
-#include_next <stdio.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-#if defined(__USE_FILE_OFFSET64) && __ANDROID_API__ < __ANDROID_API_N__
-// Not really available, but we need a decl to allow `#include <cstdio>`.
-int fgetpos(FILE*, const fpos_t*) __RENAME(fgetpos64);
-int fsetpos(FILE*, const fpos_t*) __RENAME(fsetpos64);
-#endif
-
-__END_DECLS
diff --git a/tests/build/fob64_19/CMakeLists.txt b/tests/build/fob64_19/CMakeLists.txt
new file mode 100644
index 0000000..3f501e0
--- /dev/null
+++ b/tests/build/fob64_19/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.6.0)
+
+add_library(libfoo
+  STATIC
+    jni/foo.cpp
+)
diff --git a/tests/build/fob64_19/jni/Android.mk b/tests/build/fob64_19/jni/Android.mk
new file mode 100644
index 0000000..7ce18d5
--- /dev/null
+++ b/tests/build/fob64_19/jni/Android.mk
@@ -0,0 +1,6 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo
+LOCAL_SRC_FILES := foo.cpp
+include $(BUILD_STATIC_LIBRARY)
diff --git a/tests/build/fob64_19/jni/Application.mk b/tests/build/fob64_19/jni/Application.mk
new file mode 100644
index 0000000..05e396c
--- /dev/null
+++ b/tests/build/fob64_19/jni/Application.mk
@@ -0,0 +1,2 @@
+APP_STL := c++_static
+APP_PLATFORM := android-19
diff --git a/tests/build/fob64_19/jni/foo.cpp b/tests/build/fob64_19/jni/foo.cpp
new file mode 100644
index 0000000..584c576
--- /dev/null
+++ b/tests/build/fob64_19/jni/foo.cpp
@@ -0,0 +1,10 @@
+#define _FILE_OFFSET_BITS 64
+#include <cstdio>
+
+namespace {
+
+// These should be unavailable before android-24, and available afterward.
+using ::fgetpos;
+using ::fsetpos;
+
+}
diff --git a/tests/build/fob64_19/test_config.py b/tests/build/fob64_19/test_config.py
new file mode 100644
index 0000000..ca31f13
--- /dev/null
+++ b/tests/build/fob64_19/test_config.py
@@ -0,0 +1,12 @@
+def is_negative_test():
+    return True
+
+
+def extra_cmake_flags():
+    return ['-DANDROID_PLATFORM=android-19']
+
+
+def build_unsupported(abi, _api):
+    if '64' in abi:
+        return abi
+    return None
diff --git a/tests/build/fob64_21/CMakeLists.txt b/tests/build/fob64_21/CMakeLists.txt
new file mode 100644
index 0000000..3f501e0
--- /dev/null
+++ b/tests/build/fob64_21/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.6.0)
+
+add_library(libfoo
+  STATIC
+    jni/foo.cpp
+)
diff --git a/tests/build/fob64_21/jni/Android.mk b/tests/build/fob64_21/jni/Android.mk
new file mode 100644
index 0000000..7ce18d5
--- /dev/null
+++ b/tests/build/fob64_21/jni/Android.mk
@@ -0,0 +1,6 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo
+LOCAL_SRC_FILES := foo.cpp
+include $(BUILD_STATIC_LIBRARY)
diff --git a/tests/build/fob64_21/jni/Application.mk b/tests/build/fob64_21/jni/Application.mk
new file mode 100644
index 0000000..458001c
--- /dev/null
+++ b/tests/build/fob64_21/jni/Application.mk
@@ -0,0 +1,2 @@
+APP_STL := c++_static
+APP_PLATFORM := android-21
diff --git a/tests/build/fob64_21/jni/foo.cpp b/tests/build/fob64_21/jni/foo.cpp
new file mode 100644
index 0000000..584c576
--- /dev/null
+++ b/tests/build/fob64_21/jni/foo.cpp
@@ -0,0 +1,10 @@
+#define _FILE_OFFSET_BITS 64
+#include <cstdio>
+
+namespace {
+
+// These should be unavailable before android-24, and available afterward.
+using ::fgetpos;
+using ::fsetpos;
+
+}
diff --git a/tests/build/fob64_21/test_config.py b/tests/build/fob64_21/test_config.py
new file mode 100644
index 0000000..4747c82
--- /dev/null
+++ b/tests/build/fob64_21/test_config.py
@@ -0,0 +1,12 @@
+def is_negative_test():
+    return True
+
+
+def extra_cmake_flags():
+    return ['-DANDROID_PLATFORM=android-21']
+
+
+def build_unsupported(abi, _api):
+    if '64' in abi:
+        return abi
+    return None
diff --git a/tests/build/fob64_24/CMakeLists.txt b/tests/build/fob64_24/CMakeLists.txt
new file mode 100644
index 0000000..3f501e0
--- /dev/null
+++ b/tests/build/fob64_24/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.6.0)
+
+add_library(libfoo
+  STATIC
+    jni/foo.cpp
+)
diff --git a/tests/build/fob64_24/jni/Android.mk b/tests/build/fob64_24/jni/Android.mk
new file mode 100644
index 0000000..7ce18d5
--- /dev/null
+++ b/tests/build/fob64_24/jni/Android.mk
@@ -0,0 +1,6 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo
+LOCAL_SRC_FILES := foo.cpp
+include $(BUILD_STATIC_LIBRARY)
diff --git a/tests/build/fob64_24/jni/Application.mk b/tests/build/fob64_24/jni/Application.mk
new file mode 100644
index 0000000..689fdd7
--- /dev/null
+++ b/tests/build/fob64_24/jni/Application.mk
@@ -0,0 +1,2 @@
+APP_STL := c++_static
+APP_PLATFORM := android-24
diff --git a/tests/build/fob64_24/jni/foo.cpp b/tests/build/fob64_24/jni/foo.cpp
new file mode 100644
index 0000000..584c576
--- /dev/null
+++ b/tests/build/fob64_24/jni/foo.cpp
@@ -0,0 +1,10 @@
+#define _FILE_OFFSET_BITS 64
+#include <cstdio>
+
+namespace {
+
+// These should be unavailable before android-24, and available afterward.
+using ::fgetpos;
+using ::fsetpos;
+
+}
diff --git a/tests/build/fob64_24/test_config.py b/tests/build/fob64_24/test_config.py
new file mode 100644
index 0000000..86f130c
--- /dev/null
+++ b/tests/build/fob64_24/test_config.py
@@ -0,0 +1,8 @@
+def extra_cmake_flags():
+    return ['-DANDROID_PLATFORM=android-24']
+
+
+def build_unsupported(abi, _api):
+    if '64' in abi:
+        return abi
+    return None
diff --git a/tests/build/libcxx_headers/CMakeLists.txt b/tests/build/libcxx_headers/CMakeLists.txt
new file mode 100644
index 0000000..3f501e0
--- /dev/null
+++ b/tests/build/libcxx_headers/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.6.0)
+
+add_library(libfoo
+  STATIC
+    jni/foo.cpp
+)
diff --git a/tests/build/libcxx_headers/jni/Android.mk b/tests/build/libcxx_headers/jni/Android.mk
new file mode 100644
index 0000000..d9d1555
--- /dev/null
+++ b/tests/build/libcxx_headers/jni/Android.mk
@@ -0,0 +1,6 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo
+LOCAL_SRC_FILES := foo.cpp
+include $(BUILD_EXECUTABLE)
diff --git a/tests/build/libcxx_headers/jni/Application.mk b/tests/build/libcxx_headers/jni/Application.mk
new file mode 100644
index 0000000..ce09535
--- /dev/null
+++ b/tests/build/libcxx_headers/jni/Application.mk
@@ -0,0 +1 @@
+APP_STL := c++_static
diff --git a/tests/build/libcxx_headers/jni/foo.cpp b/tests/build/libcxx_headers/jni/foo.cpp
new file mode 100644
index 0000000..3cead3d
--- /dev/null
+++ b/tests/build/libcxx_headers/jni/foo.cpp
@@ -0,0 +1,28 @@
+#include <cassert>
+#include <ccomplex>
+#include <cctype>
+#include <cerrno>
+#include <cfenv>
+#include <cfloat>
+#include <cinttypes>
+#include <ciso646>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstdbool>
+#include <cstddef>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctgmath>
+#include <ctime>
+#include <cwchar>
+#include <cwctype>
+
+int main(int argc, char** argv) {
+  return 0;
+}
diff --git a/tests/build/libcxx_headers_no_android_support/CMakeLists.txt b/tests/build/libcxx_headers_no_android_support/CMakeLists.txt
new file mode 100644
index 0000000..3f501e0
--- /dev/null
+++ b/tests/build/libcxx_headers_no_android_support/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.6.0)
+
+add_library(libfoo
+  STATIC
+    jni/foo.cpp
+)
diff --git a/tests/build/libcxx_headers_no_android_support/jni/Android.mk b/tests/build/libcxx_headers_no_android_support/jni/Android.mk
new file mode 100644
index 0000000..d9d1555
--- /dev/null
+++ b/tests/build/libcxx_headers_no_android_support/jni/Android.mk
@@ -0,0 +1,6 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo
+LOCAL_SRC_FILES := foo.cpp
+include $(BUILD_EXECUTABLE)
diff --git a/tests/build/libcxx_headers_no_android_support/jni/Application.mk b/tests/build/libcxx_headers_no_android_support/jni/Application.mk
new file mode 100644
index 0000000..1a99581
--- /dev/null
+++ b/tests/build/libcxx_headers_no_android_support/jni/Application.mk
@@ -0,0 +1,2 @@
+APP_PLATFORM := android-21
+APP_STL := c++_static
diff --git a/tests/build/libcxx_headers_no_android_support/jni/foo.cpp b/tests/build/libcxx_headers_no_android_support/jni/foo.cpp
new file mode 100644
index 0000000..3cead3d
--- /dev/null
+++ b/tests/build/libcxx_headers_no_android_support/jni/foo.cpp
@@ -0,0 +1,28 @@
+#include <cassert>
+#include <ccomplex>
+#include <cctype>
+#include <cerrno>
+#include <cfenv>
+#include <cfloat>
+#include <cinttypes>
+#include <ciso646>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstdbool>
+#include <cstddef>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctgmath>
+#include <ctime>
+#include <cwchar>
+#include <cwctype>
+
+int main(int argc, char** argv) {
+  return 0;
+}
diff --git a/tests/build/libcxx_headers_no_android_support/test_config.py b/tests/build/libcxx_headers_no_android_support/test_config.py
new file mode 100644
index 0000000..b84c8fe
--- /dev/null
+++ b/tests/build/libcxx_headers_no_android_support/test_config.py
@@ -0,0 +1,2 @@
+def extra_cmake_flags():
+    return ['-DANDROID_PLATFORM=android-21']