OSDN Git Service

d5af89fbc83c9c14092a7650382e56cc3821a7ae
[pf3gnuchains/gcc-fork.git] / gcc / config / vax / xm-vms.h
1 /* Configuration for GNU C-compiler for Vax.
2    Copyright (C) 1987, 1994, 1995, 1996, 1997, 2001
3    Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 /* Other configurations get these via autoconfig.  */
23 #define STDC_HEADERS 1
24 #define HAVE_STDLIB_H 1
25 #define HAVE_STRING_H 1
26 #ifdef __DECC
27 #define HAVE_UNISTD_H 1
28 #endif
29
30 #if defined(VAXC) || defined(__DECC)
31 /* if compiling with VAXC, need to fix problem with <stdio.h>
32    which defines a macro called FILE_TYPE that breaks "tree.h".
33    Fortunately it uses #ifndef to suppress multiple inclusions.
34    Three possible cases:
35         1) <stdio.h> has already been included -- ours will be no-op;
36         2) <stdio.h> will be included after us -- "theirs" will be no-op;
37         3) <stdio.h> isn't needed -- including it here shouldn't hurt.
38    In all three cases, the problem macro will be removed here.  */
39 #include <stdio.h>
40 #undef FILE_TYPE
41 #endif
42
43 /* This describes the machine the compiler is hosted on.  */
44 #define HOST_BITS_PER_CHAR 8
45 #define HOST_BITS_PER_SHORT 16
46 #define HOST_BITS_PER_INT 32
47 #define HOST_BITS_PER_LONG 32
48 #define HOST_BITS_PER_LONGLONG 64
49
50 #define HOST_FLOAT_FORMAT VAX_FLOAT_FORMAT
51
52 #define SUCCESS_EXIT_CODE 1
53 #define FATAL_EXIT_CODE (44 | 0x10000000)  /* Abort, and no DCL message.  */
54
55 /* A couple of conditionals for execution machine are controlled here.  */
56 #ifndef VMS
57 #define VMS
58 #endif
59
60 #define GCC_INCLUDE_DIR "///not used with VMS///"       /* nonsense string for now */
61
62 /* and define a local equivalent (sort of) for unlink */
63 #define unlink remove
64
65 /* Under VMS a directory specification can be enclosed either in square
66    brackets or in angle brackets.  Thus we need to check both.  This
67    macro is used to help compare filenames in cp-lex.c.
68
69    We also need to make sure that the names are all lower case, because
70    we must be able to compare filenames to determine if a file implements
71    a class.  */
72
73 #define FILE_NAME_NONDIRECTORY(C)                               \
74 ({                                                              \
75    char * pnt_ = (C), * pnt1_;                                  \
76    pnt1_ = pnt_ - 1;                                            \
77    while (*++pnt1_)                                             \
78      if ((*pnt1_ >= 'A' && *pnt1_ <= 'Z')) *pnt1_ |= 0x20;      \
79    pnt1_ = strrchr (pnt_, ']');                                 \
80    pnt1_ = (pnt1_ == 0 ? strrchr (pnt_, '>') : pnt1_);          \
81    pnt1_ = (pnt1_ == 0 ? strrchr (pnt_, ':') : pnt1_);          \
82    (pnt1_ == 0 ? pnt_ : pnt1_ + 1);                             \
83  })
84
85 /* Macro to generate the name of the cross reference file.  The standard
86    one does not work, since it was written assuming that the conventions
87    of a unix style filesystem will work on the host system.  */
88
89 #define XREF_FILE_NAME(BUFF, NAME)      \
90   s = FILE_NAME_NONDIRECTORY (NAME);                    \
91   if (s == NAME) sprintf(BUFF, "%s_gxref", NAME);       \
92   else {                                                \
93     strcpy(BUFF, NAME);                                 \
94     strcat(BUFF, "_gxref");                             \
95   }
96
97 /* Macro that is used in cp-xref.c to determine whether a file name is
98    absolute or not.  */
99
100 #define FILE_NAME_ABSOLUTE_P(NAME)      \
101         (FILE_NAME_NONDIRECTORY (NAME) != (&NAME[1]))
102
103 /* FILE_NAME_JOINER is defined to be the characters that are inserted between 
104    a directory name and a filename in order to make an absolute file
105    specification.  Under VMS the directory specification contains all of the
106    required characters, so we define this to be a null string.  */
107
108 #define FILE_NAME_JOINER ""
109
110 /* vprintf() has been available since VMS V4.6.  */
111
112 #define HAVE_VPRINTF
113 \f
114 #if defined(VAXC) || defined(__DECC)
115
116 /* Customizations/kludges for building with DEC's VAX C compiler
117    rather than GCC.  */
118
119 #define USE_C_ALLOCA            /* using alloca.c */
120 #define QSORT_WORKAROUND        /* do not use VAXCRTL's qsort */
121
122 /* use ANSI/SYSV style byte manipulation routines instead of BSD ones */
123 /* rename all too-long external symbol names to avoid warnings */
124 #define check_for_full_enumeration_handling     check_for_full_enum_handling
125 #define current_function_contains_functions     curfunc_contains_functions
126 #define current_function_epilogue_delay_list    curfunc_epilogue_delay_list
127 #define current_function_has_nonlocal_goto      curfunc_has_nonlocal_goto
128 #define current_function_has_nonlocal_label     curfunc_has_nonlocal_label
129 #define current_function_internal_arg_pointer   curfunc_internal_arg_pointer
130 #define current_function_outgoing_args_size     curfunc_outgoing_args_size
131 #define current_function_pretend_args_size      curfunc_pretend_args_size
132 #define current_function_returns_pcc_struct     curfunc_returns_pcc_struct
133 #define current_function_returns_pointer        curfunc_returns_pointer
134 #define current_function_uses_const_pool        curfunc_uses_const_pool
135 #define current_function_uses_pic_offset_table  curfunc_uses_pic_offset_table
136 #define dbxout_resume_previous_source_file      dbxout_resume_previous_src_file
137 #define expand_builtin_extract_return_addr      expand_builtin_extract_ret_addr
138 #define expand_builtin_set_return_addr_reg      expand_builtin_set_ret_addr_reg
139 #define expand_start_loop_continue_elsewhere    expnd_start_loop_cont_elsewhere
140 #define flag_schedule_insns_after_reload        flag_sched_insns_after_reload
141 #define get_dynamic_handler_chain_libfunc       get_dynamic_hndlr_chain_libfunc
142 #define lookup_name_current_level_global        lookup_name_current_level_gbl
143 #define maybe_building_objc_message_expr        maybe_building_objc_msg_expr
144 #define mesg_implicit_function_declaration      mesg_implicit_func_declaration
145 #define output_deferred_addressed_constants     output_deferred_addr_constants
146 #define protect_cleanup_actions_with_terminate  protect_cleanup_act_w_terminate
147 #define reg_overlap_mentioned_for_reload_p      reg_overlap_mtnd_for_reload_p
148 #define reposition_prologue_and_epilogue_notes  repos_prolog_and_epilog_notes
149 #define rtx_equal_function_value_matters        rtx_equal_func_value_matters
150 #define set_new_first_and_last_label_num        set_new_first_and_last_lbl_num
151 #define thread_prologue_and_epilogue_insns      thread_prolog_and_epilog_insns
152 #endif
153
154 /* We need to avoid the library qsort routine, due to a serious bug
155    in VAXCRTL.  (Sorting anything with size that's not a multiple of 4
156    after having previously sorted something that was a multiple of 4
157    can produce wrong results and result in data corruption.)  We'll
158    use our own substitute (in vax.c) instead.  */
159 #ifdef QSORT_WORKAROUND
160 #define qsort not_qsort
161 #endif
162
163 #ifdef __DECC
164 /* DECC$SHR doesn't have VAXCRTL's bugs.  */
165 #undef QSORT_WORKAROUND
166 #undef qsort
167 /* Avoid a lot of informational level diagnostics about implicitly
168    declared functions.  */
169 #include <stdlib.h>
170 #include <string.h>
171 /* this is for genopinit.c */
172  #pragma message disable (undefescap)
173 #endif
174
175 #if defined(USE_C_ALLOCA) && !defined(alloca)
176 /* Declare alloca() using similar logic to that in alloca.c.  */
177 #ifdef __STDC__
178 extern void *alloca(unsigned);
179 #else
180 extern char *alloca();
181 #endif
182 #endif
183
184 #define OBJECT_SUFFIX ".obj"
185 #define EXECUTABLE_SUFFIX ".exe"