From: Rainer Orth Date: Mon, 24 Feb 2003 18:46:26 +0000 (+0000) Subject: re PR c/5059 (Compiling s/w containing the use of DIR.H fails on other stat-calls) X-Git-Tag: releases/gcc-3.2.3~166 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7535cd74bddcd5d6681c43107ed37576a189ee90;p=thirdparty%2Fgcc.git re PR c/5059 (Compiling s/w containing the use of DIR.H fails on other stat-calls) * config/alpha/osf.h (CPP_SUBTARGET_SPEC): 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 . * 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: r63369 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cde23da87302..17c26173c3b5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2003-02-24 Rainer Orth + + * config/alpha/osf.h (CPP_SUBTARGET_SPEC): 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 . + * 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 David Billinghurst Fixes PR libgcj/9652. diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h index efb0a16d7fd0..69d8b2485da4 100644 --- a/gcc/config/alpha/osf.h +++ b/gcc/config/alpha/osf.h @@ -1,5 +1,5 @@ /* 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. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) @@ -48,7 +48,7 @@ Boston, MA 02111-1307, USA. */ #undef CPP_SUBTARGET_SPEC #define CPP_SUBTARGET_SPEC \ "%{pthread|threads:-D_REENTRANT} %{threads:-D_PTHREAD_USE_D4} %(cpp_xfloat) \ --D__EXTERN_PREFIX" +-D__PRAGMA_EXTERN_PREFIX" /* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */ diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 281e4ac932e1..19e13f4e157a 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -6072,7 +6072,8 @@ empty string. This pragma is similar in intent to to the asm labels extension (@pxref{Asm Labels}) in that the system programmer wants to change 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 @node Unnamed Fields diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x index 291b7bf2ccbf..63c08c6e8745 100644 --- a/gcc/fixinc/fixincl.x +++ b/gcc/fixinc/fixincl.x @@ -774,6 +774,43 @@ static const char* apzAlpha___AssertPatch[] = { "__assert(const char *, const char *, int)", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * 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 @@ -5840,6 +5877,7 @@ typedef enum { AIX_SYSWAIT_FIXIDX, AIX_VOLATILE_FIXIDX, ALPHA___ASSERT_FIXIDX, + ALPHA___EXTERN_PREFIX_FIXIDX, ALPHA_ASSERT_FIXIDX, ALPHA_GETOPT_FIXIDX, ALPHA_PARENS_FIXIDX, @@ -6054,6 +6092,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ALPHA___ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, 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, apzAlpha_AssertMachs, ALPHA_ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 0da2572b78e0..18eaa10f930f 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -602,6 +602,22 @@ fix = { }; +/* + * Obey __PRAGMA_EXTERN_PREFIX for Tru64 UNIX V5 . + */ +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. * The superfluous int cast breaks C++. diff --git a/gcc/fixinc/tests/base/sys/stat.h b/gcc/fixinc/tests/base/sys/stat.h index 46a4623cd272..9ec4079f6d07 100644 --- a/gcc/fixinc/tests/base/sys/stat.h +++ b/gcc/fixinc/tests/base/sys/stat.h @@ -9,6 +9,11 @@ +#if defined( ALPHA___EXTERN_PREFIX_CHECK ) +# if defined(__DECC) || defined(__PRAGMA_EXTERN_PREFIX) +#endif /* ALPHA___EXTERN_PREFIX_CHECK */ + + #if defined( M88K_BAD_S_IF_CHECK ) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) /* is regular? */ #endif /* M88K_BAD_S_IF_CHECK */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 88dcd59be16f..14626855d233 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-02-24 Rainer Orth + + * g++.dg/other/pragma-ep-1.C: Test for __PRAGMA_EXTERN_PREFIX. + * gcc.dg/pragma-ep-1.c: Likewise. + 2003-02-24 Kriang Lerdsuwanakij PR c++/9602 diff --git a/gcc/testsuite/g++.dg/other/pragma-ep-1.C b/gcc/testsuite/g++.dg/other/pragma-ep-1.C index 99450cd79e48..151003cb1539 100644 --- a/gcc/testsuite/g++.dg/other/pragma-ep-1.C +++ b/gcc/testsuite/g++.dg/other/pragma-ep-1.C @@ -5,7 +5,7 @@ /* { dg-final { scan-assembler "four" } } */ /* { dg-final { scan-assembler-not "_four" } } */ -#ifndef __EXTERN_PREFIX +#ifndef __PRAGMA_EXTERN_PREFIX #error #endif diff --git a/gcc/testsuite/gcc.dg/pragma-ep-1.c b/gcc/testsuite/gcc.dg/pragma-ep-1.c index 91ec640ca5bc..e110ff900041 100644 --- a/gcc/testsuite/gcc.dg/pragma-ep-1.c +++ b/gcc/testsuite/gcc.dg/pragma-ep-1.c @@ -5,7 +5,7 @@ /* { dg-final { scan-assembler "four" } } */ /* { dg-final { scan-assembler-not "_four" } } */ -#ifndef __EXTERN_PREFIX +#ifndef __PRAGMA_EXTERN_PREFIX #error #endif