--- gcc/config/vax/vms.h 2018/04/24 18:22:18 1.1.1.3 +++ gcc/config/vax/vms.h 2018/04/24 18:30:00 1.1.1.4 @@ -1,5 +1,5 @@ /* Output variables, constants and external declarations, for GNU compiler. - Copyright (C) 1988, 1994 Free Software Foundation, Inc. + Copyright (C) 1988, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. @@ -15,7 +15,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #define VMS_TARGET @@ -41,7 +42,7 @@ the Free Software Foundation, 675 Mass A and GNU CPP is not used on VMS except with GNU C. */ #define CPP_PREDEFINES \ "-Dvax -Dvms -DVMS -D__vax__ -D__vms__ -D__VMS__\ - -D__GNUC__=2 -D__GNUC_MINOR__=6 -Asystem(vms) -Acpu(vax) -Amachine(vax)" + -D__GNUC__=2 -D__GNUC_MINOR__=7 -Asystem(vms) -Acpu(vax) -Amachine(vax)" /* These match the definitions used in VAXCRTL, the VMS C run-time library */ @@ -316,6 +317,9 @@ const_section () \ fputc ('\n', (FILE)); \ } +/* True for VMS V4.6 and later. */ +#define HAVE_ATEXIT + /* The following definitions are used in libgcc2.c with the __main function. The _SHR symbol is used when the sharable image library for libg++ is used - this is picked up automatically by the linker @@ -334,25 +338,22 @@ const_section () \ #define DO_GLOBAL_CTORS_BODY \ do { \ func_ptr *p; \ - extern func_ptr __CTOR_LIST__[1]; \ - extern func_ptr __CTOR_LIST_END__[1]; \ - extern func_ptr __CTOR_LIST_SHR__[1]; \ - extern func_ptr __CTOR_LIST_SHR_END__[1]; \ - if( &__CTOR_LIST_SHR__[0] != &__CTOR_LIST__[1]) \ - for (p = __CTOR_LIST_SHR__ + 1; p < __CTOR_LIST_SHR_END__ ; p++ ) \ - if (*p) (*p) (); \ + extern func_ptr __CTOR_LIST__[1], __CTOR_LIST_END__[1]; \ + extern func_ptr __CTOR_LIST_SHR__[1], __CTOR_LIST_SHR_END__[1]; \ + if (&__CTOR_LIST_SHR__[0] != &__CTOR_LIST__[1]) \ + for (p = __CTOR_LIST_SHR__ + 1; p < __CTOR_LIST_SHR_END__ ; p++ ) \ + if (*p) (*p) (); \ for (p = __CTOR_LIST__ + 1; p < __CTOR_LIST_END__ ; p++ ) \ if (*p) (*p) (); \ - atexit (__do_global_dtors); \ - { \ + do { /* arrange for `return' from main() to pass through exit() */ \ __label__ foo; \ int *callers_caller_fp = (int *) __builtin_frame_address (3); \ register int retval asm ("r0"); \ callers_caller_fp[4] = (int) && foo; \ - return; \ + break; /* out of do-while block */ \ foo: \ exit (retval); \ - } \ + } while (0); \ } while (0) #define __DTOR_LIST__ __gxx_clean_0 @@ -364,15 +365,13 @@ do { \ #define DO_GLOBAL_DTORS_BODY \ do { \ func_ptr *p; \ - extern func_ptr __DTOR_LIST__[1]; \ - extern func_ptr __DTOR_LIST_END__[1]; \ - extern func_ptr __DTOR_LIST_SHR__[1]; \ - extern func_ptr __DTOR_LIST_SHR_END__[1]; \ + extern func_ptr __DTOR_LIST__[1], __DTOR_LIST_END__[1]; \ + extern func_ptr __DTOR_LIST_SHR__[1], __DTOR_LIST_SHR_END__[1]; \ for (p = __DTOR_LIST__ + 1; p < __DTOR_LIST_END__ ; p++ ) \ if (*p) (*p) (); \ - if( &__DTOR_LIST_SHR__[0] != &__DTOR_LIST__[1]) \ - for (p = __DTOR_LIST_SHR__ + 1; p < __DTOR_LIST_SHR_END__ ; p++ ) \ - if (*p) (*p) (); \ + if (&__DTOR_LIST_SHR__[0] != &__DTOR_LIST__[1]) \ + for (p = __DTOR_LIST_SHR__ + 1; p < __DTOR_LIST_SHR_END__ ; p++ ) \ + if (*p) (*p) (); \ } while (0) #endif /* L__main */