diff options
author | Peter O'Gorman <pogma@thewrittenword.com> | 2008-03-07 06:53:59 +0000 |
---|---|---|
committer | Ralf Wildenhues <rwild@gcc.gnu.org> | 2008-03-07 06:53:59 +0000 |
commit | 83644cd5009a9bbd7d30d741251ceabb6e8604d7 (patch) | |
tree | 072652d60f8a677c86c43e463b9022934574a6d7 /gcc | |
parent | cb6f415f34f831b7f84be0f64879eca01ab74051 (diff) | |
download | gcc-83644cd5009a9bbd7d30d741251ceabb6e8604d7.zip gcc-83644cd5009a9bbd7d30d741251ceabb6e8604d7.tar.gz gcc-83644cd5009a9bbd7d30d741251ceabb6e8604d7.tar.bz2 |
re PR target/20366 (AIX g++ -D_LARGE_FILES fails to compile #include <iostream>)
fixincludes/
2008-03-07 Peter O'Gorman <pogma@thewrittenword.com>
PR c++/20366
* inclhack.def (AAB_aix_stdio): Hack stdio.h for -D_LARGE_FILES.
* fixincl.x: Regenerate.
* tests/base/stdio.h: Add test.
gcc/testsuite/
2008-03-07 Peter O'Gorman <pogma@thewrittenword.com>
PR c++/20366
* g++.dg/other/pr20366.C: New test.
From-SVN: r133001
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/pr20366.C | 80 |
2 files changed, 85 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b24b8da..d9566e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-03-07 Peter O'Gorman <pogma@thewrittenword.com> + + PR c++/20366 + * g++.dg/other/pr20366.C: New test. + 2008-03-06 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/35402 diff --git a/gcc/testsuite/g++.dg/other/pr20366.C b/gcc/testsuite/g++.dg/other/pr20366.C new file mode 100644 index 0000000..36a689e --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr20366.C @@ -0,0 +1,80 @@ +// Test fix for PR20366 +// +// { dg-do compile { target *-*-aix* } } +// { dg-options "-D_LARGE_FILES" } +// +// cstdio includes stdio.h and undefs most of the functions declared +// therein, unfortunately this means that #define fopen fopen64 goes +// away. This tests the fix, and ensures that with -D_LARGE_FILES +// fopen et. al. are indeed aliased to the large file equivalents. +// +// There are many other #define foo foo64 in the AIX headers, but +// these all work out fine as they are not undefined in libstdc++. +// This list is probably incomplete: +// +// Symbol Return type Large file declaration. +// +// aio.h (different for different AIX versions) +// ===== +// aio_read int aio_read64(int, struct aiocb64 *); +// aio_write int aio_write64(int, struct aiocb64 *); +// lio_listio int lio_listio64(int, struct liocb64 *[], int, void *); +// aio_cancel int aio_cancel64(int, struct aiocb64 *); +// aio_suspend int aio_suspend64(int, struct aiocb64 *[]); +// +// stdio.h +// ======= +// fgetpos int fgetpos64(FILE *, fpos64_t *); +// fopen FILE *fopen64(const char *, const char *); +// freopen FILE *freopen64(const char *, const char *, FILE *); +// fseeko int fseeko64(FILE *, off64_t, int); +// fsetpos int fsetpos64(FILE *, const fpos64_t *); +// ftello off64_t ftello64(FILE *); +// +// unistd.h +// ======== +// fclear off64_t fclear64(int, off64_t); +// fsync_range int fsync_range64(int, int, off64_t, off64_t); +// ftruncate int ftruncate64(int, off64_t); +// truncate int truncate64(const char *, off64_t); +// lseek off64_t lseek64(int, off64_t, int); +// pread ssize_t pread64(int, void *, size_t, off64_t); +// pwrite ssize_t pwrite64(int, const void *, size_t, off64_t); +// +// fcntl.h +// ======= +// open int open64(const char *, int, ...); +// creat int creat64(const char *, mode_t); +// +// sys/stat.h +// ========== +// stat int stat64(const char *, struct stat64 *); +// fstat int fstat64(int, struct stat64 *); +// lstat int lstat64(const char *, struct stat64 *); +// +// stdlib.h +// ======== +// mkstemp int mkstemp64(char *); +// +// ftw.h +// ===== +// ftw int ftw64(const char *, int (*)(const char *,const struct stat64 *, int), int); +// nftw int nftw64(const char *, int (*)(const char *, const struct stat64 *, int, struct FTW*), int, int); +// +// It seems unlikely that any of these will be used (and #undef'ed) by +// libstdc++ in the future, if they are then this test and its +// associated patch to fixincludes will have to be revisited. + +#include <cstdio> + +extern "C" { +int fgetpos(FILE *, fpos64_t *); +FILE *fopen(const char *, const char *); +FILE *freopen(const char *, const char *, FILE *); +int fseeko(FILE *, off64_t, int); +int fsetpos(FILE *, const fpos64_t *); +off64_t ftello(FILE *); +} +int main() { + return 0; +} |