Commit f8dc212b by Rainer Orth Committed by Rainer Orth

re PR c/5059 (Compiling s/w containing the use of DIR.H fails on other stat-calls)

	* config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Rename
	__EXTERN_PREFIX to __PRAGMA_EXTERN_PREFIX.
	* doc/extend.texi (Tru64 Pragmas): Reflect this.

	* fixinc/inclhack.def (alpha___extern_prefix): Indicate #pragma
	extern_prefix support for Tru64 UNIX V5 <sys/stat.h>.
	* fixinc/fixincl.x: Regenerate.
	* fixinc/tests/base/sys/stat.h [ALPHA___EXTERN_PREFIX_CHECK]: New
	testcase.
	Fixes PR c/5059, c/6126, other/9671.

	testsuite:
	* g++.dg/other/pragma-ep-1.C: Test for __PRAGMA_EXTERN_PREFIX.
	* gcc.dg/pragma-ep-1.c: Likewise.

From-SVN: r63370
parent 391cd095
2003-02-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Rename
__EXTERN_PREFIX to __PRAGMA_EXTERN_PREFIX.
* doc/extend.texi (Tru64 Pragmas): Reflect this.
* fixinc/inclhack.def (alpha___extern_prefix): Indicate #pragma
extern_prefix support for Tru64 UNIX V5 <sys/stat.h>.
* fixinc/fixincl.x: Regenerate.
* fixinc/tests/base/sys/stat.h [ALPHA___EXTERN_PREFIX_CHECK]: New
testcase.
Fixes PR c/5059, c/6126, other/9671.
2003-02-24 Roger Sayle <roger@eyesopen.com> 2003-02-24 Roger Sayle <roger@eyesopen.com>
* gcc.c (do_spec_1) ['{']: Handle pending argument upon return * gcc.c (do_spec_1) ['{']: Handle pending argument upon return
......
/* Definitions of target machine for GNU compiler, for DEC Alpha on OSF/1. /* Definitions of target machine for GNU compiler, for DEC Alpha on OSF/1.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
...@@ -39,7 +39,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -39,7 +39,7 @@ Boston, MA 02111-1307, USA. */
builtin_define ("_SYSTYPE_BSD"); \ builtin_define ("_SYSTYPE_BSD"); \
builtin_define ("__osf__"); \ builtin_define ("__osf__"); \
builtin_define ("_LONGLONG"); \ builtin_define ("_LONGLONG"); \
builtin_define ("__EXTERN_PREFIX"); \ builtin_define ("__PRAGMA_EXTERN_PREFIX"); \
builtin_assert ("system=unix"); \ builtin_assert ("system=unix"); \
builtin_assert ("system=xpg4"); \ builtin_assert ("system=xpg4"); \
/* Tru64 UNIX V5 has a 16 byte long \ /* Tru64 UNIX V5 has a 16 byte long \
......
...@@ -6588,7 +6588,8 @@ empty string. ...@@ -6588,7 +6588,8 @@ empty string.
This pragma is similar in intent to to the asm labels extension This pragma is similar in intent to to the asm labels extension
(@pxref{Asm Labels}) in that the system programmer wants to change (@pxref{Asm Labels}) in that the system programmer wants to change
the assembly-level ABI without changing the source-level API. The the assembly-level ABI without changing the source-level API. The
preprocessor defines @code{__EXTERN_PREFIX} if the pragma is available. preprocessor defines @code{__PRAGMA_EXTERN_PREFIX} if the pragma is
available.
@end table @end table
@node Unnamed Fields @node Unnamed Fields
......
...@@ -711,6 +711,43 @@ static const char* apzAlpha___AssertPatch[] = { ...@@ -711,6 +711,43 @@ static const char* apzAlpha___AssertPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Description of Alpha___Extern_Prefix fix
*/
tSCC zAlpha___Extern_PrefixName[] =
"alpha___extern_prefix";
/*
* File name selection pattern
*/
tSCC zAlpha___Extern_PrefixList[] =
"|sys/stat.h|";
/*
* Machine/OS name selection pattern
*/
tSCC* apzAlpha___Extern_PrefixMachs[] = {
"alpha*-dec-osf5*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zAlpha___Extern_PrefixSelect0[] =
"#[ \t]*if[ \t]*defined\\(__DECC\\)";
#define ALPHA___EXTERN_PREFIX_TEST_CT 1
static tTestDesc aAlpha___Extern_PrefixTests[] = {
{ TT_EGREP, zAlpha___Extern_PrefixSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Alpha___Extern_Prefix
*/
static const char* apzAlpha___Extern_PrefixPatch[] = {
"format",
"%0 || defined(__PRAGMA_EXTERN_PREFIX)",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Alpha_Assert fix * Description of Alpha_Assert fix
*/ */
tSCC zAlpha_AssertName[] = tSCC zAlpha_AssertName[] =
...@@ -5788,6 +5825,7 @@ typedef enum { ...@@ -5788,6 +5825,7 @@ typedef enum {
AIX_SYSWAIT_FIXIDX, AIX_SYSWAIT_FIXIDX,
AIX_VOLATILE_FIXIDX, AIX_VOLATILE_FIXIDX,
ALPHA___ASSERT_FIXIDX, ALPHA___ASSERT_FIXIDX,
ALPHA___EXTERN_PREFIX_FIXIDX,
ALPHA_ASSERT_FIXIDX, ALPHA_ASSERT_FIXIDX,
ALPHA_GETOPT_FIXIDX, ALPHA_GETOPT_FIXIDX,
ALPHA_PARENS_FIXIDX, ALPHA_PARENS_FIXIDX,
...@@ -5993,6 +6031,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ...@@ -5993,6 +6031,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
ALPHA___ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, ALPHA___ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aAlpha___AssertTests, apzAlpha___AssertPatch, 0 }, aAlpha___AssertTests, apzAlpha___AssertPatch, 0 },
{ zAlpha___Extern_PrefixName, zAlpha___Extern_PrefixList,
apzAlpha___Extern_PrefixMachs,
ALPHA___EXTERN_PREFIX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aAlpha___Extern_PrefixTests, apzAlpha___Extern_PrefixPatch, 0 },
{ zAlpha_AssertName, zAlpha_AssertList, { zAlpha_AssertName, zAlpha_AssertList,
apzAlpha_AssertMachs, apzAlpha_AssertMachs,
ALPHA_ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, ALPHA_ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
......
...@@ -523,6 +523,22 @@ fix = { ...@@ -523,6 +523,22 @@ fix = {
/* /*
* Obey __PRAGMA_EXTERN_PREFIX for Tru64 UNIX V5 <sys/stat.h>.
*/
fix = {
hackname = alpha___extern_prefix;
files = sys/stat.h;
select = "#[ \t]*if[ \t]*defined\\(__DECC\\)";
mach = "alpha*-dec-osf5*";
c_fix = format;
c_fix_arg = "%0 || defined(__PRAGMA_EXTERN_PREFIX)";
test_text = "# if defined(__DECC)";
};
/*
* Fix assert macro in assert.h on Alpha OSF/1. * Fix assert macro in assert.h on Alpha OSF/1.
* The superfluous int cast breaks C++. * The superfluous int cast breaks C++.
*/ */
......
2003-02-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* g++.dg/other/pragma-ep-1.C: Test for __PRAGMA_EXTERN_PREFIX.
* gcc.dg/pragma-ep-1.c: Likewise.
2003-02-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> 2003-02-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9602 PR c++/9602
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
/* { dg-final { scan-assembler "four" } } */ /* { dg-final { scan-assembler "four" } } */
/* { dg-final { scan-assembler-not "_four" } } */ /* { dg-final { scan-assembler-not "_four" } } */
#ifndef __EXTERN_PREFIX #ifndef __PRAGMA_EXTERN_PREFIX
#error #error
#endif #endif
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
/* { dg-final { scan-assembler "four" } } */ /* { dg-final { scan-assembler "four" } } */
/* { dg-final { scan-assembler-not "_four" } } */ /* { dg-final { scan-assembler-not "_four" } } */
#ifndef __EXTERN_PREFIX #ifndef __PRAGMA_EXTERN_PREFIX
#error #error
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment