diff options
author | Dan Albert <danalbert@google.com> | 2017-08-16 14:05:42 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2017-08-16 14:08:02 -0700 |
commit | d5acdb0ee5ad536d543b509d83cfa79b9d01b3b1 (patch) | |
tree | cba1b806bb6c48ff92d9df5e1555c7b429a7b5ad /sources | |
parent | 25f985492b17cb6ae3dbafdbea8066552d49577f (diff) | |
download | ndk-d5acdb0ee5ad536d543b509d83cfa79b9d01b3b1.tar.gz |
Add _FILE_OFFSET_BITS=64 support for libc++.
Including things like cstdio requires that we have a decl for
everything that header needs to pull into the std namespace. We don't
actually have these functions available in this release, but we can
at least make this header includable.
Adding a test to make sure all of the C++ C headers can be included
in _FILE_OFFSET_BITS=64 mode.
Test: ./run_tests.py
Bug: https://github.com/android-ndk/ndk/issues/480
Change-Id: Icfd319b293736249e5840fee7efbce1d3b69e20b
Diffstat (limited to 'sources')
-rw-r--r-- | sources/android/support/include/stdio.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sources/android/support/include/stdio.h b/sources/android/support/include/stdio.h new file mode 100644 index 000000000..1cd038e00 --- /dev/null +++ b/sources/android/support/include/stdio.h @@ -0,0 +1,42 @@ +/* + * 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 __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 |