7 #define strcasecmp stricmp
9 #define strcasecmp _stricmp
12 #define BYTES_BIG_ENDIAN 0
14 #if defined _MSC_VER || defined __MINGW32__ || defined __BORLANDC__
16 * The following define causes the following warning:
17 * warning: `I' flag used with `%x' printf format
18 * when copiled with mingw or cygwin -mno-cygwin gcc.
19 * This is correct, because the mingw compilation links against msvcrt.dll,
20 * which uses "I46" for 64 bit integer (long long) printf lenght modifier,
21 * instead of "ll" used by libc.
23 #define PRINTF_INT64_MODIFIER "I64"
24 typedef __int64 long_long;
26 #define PRINTF_INT64_MODIFIER "ll"
27 typedef long long long_long;
33 #ifndef GET_ENVIRONMENT
34 #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
37 /* Define results of standard character escape sequences. */
38 #define TARGET_BELL 007
40 #define TARGET_TAB 011
41 #define TARGET_NEWLINE 012
45 #define TARGET_ESC 033
47 #define CHAR_TYPE_SIZE 8
48 #define WCHAR_TYPE_SIZE 32 /* ? maybe ? */
50 #define SUPPORTS_ONE_ONLY 0
52 #define TARGET_OBJECT_SUFFIX ".rel"
54 #ifndef WCHAR_UNSIGNED
55 #define WCHAR_UNSIGNED 0
61 struct diagnostic_context;
65 /* The first callback made to the front end, for simple
66 initialization needed before any calls to handle_option. Return
67 the language mask to filter the switch array with. */
68 unsigned int (*init_options) (unsigned int argc, const char **argv);
70 /* Callback used to perform language-specific initialization for the
71 global diagnostic context structure. */
72 void (*initialize_diagnostics) (struct diagnostic_context *);
74 /* Handle the switch CODE, which has real type enum opt_code from
75 options.h. If the switch takes an argument, it is passed in ARG
76 which points to permanent storage. The handler is responsible for
77 checking whether ARG is NULL, which indicates that no argument
78 was in fact supplied. For -f and -W switches, VALUE is 1 or 0
79 for the positive and negative forms respectively.
81 Return 1 if the switch is valid, 0 if invalid, and -1 if it's
82 valid and should not be treated as language-independent too. */
83 int (*handle_option) (size_t code, const char *arg, int value);
85 /* Return false to use the default complaint about a missing
86 argument, otherwise output a complaint and return true. */
87 bool (*missing_argument) (const char *opt, size_t code);
89 /* Called when all command line options have been parsed to allow
90 further processing and initialization
92 Should return true to indicate that a compiler back-end is
93 not required, such as with the -E option.
95 If errorcount is nonzero after this call the compiler exits
96 immediately and the finish hook is not called. */
97 bool (*post_options) (const char **);
99 /* Called after post_options to initialize the front end. Return
100 false to indicate that no further compilation be performed, in
101 which case the finish hook is called immediately. */
104 /* Called at the end of compilation, as a finalizer. */
105 void (*finish) (void);
107 /* Called by report_error_function to print out function name. */
108 void (*print_error_function) (struct diagnostic_context *, const char *);
111 /* Each front end provides its own. */
112 extern const struct lang_hooks lang_hooks;
117 /* If we haven't already defined a frontend specific diagnostics
118 style, use the generic one. */
119 #ifndef GCC_DIAG_STYLE
120 #define GCC_DIAG_STYLE __gcc_diag__
123 /* None of these functions are suitable for ATTRIBUTE_PRINTF, because
124 each language front end can extend them with its own set of format
125 specifiers. We must use custom format checks. */
126 #if GCC_VERSION >= 3004
127 #define ATTRIBUTE_GCC_DIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
129 #define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m)
131 extern void warning (const char *, ...);
132 extern void error (const char *, ...);
133 extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
137 /* N.B. Unlike all the others, fnotice is just gettext+fprintf, and
138 therefore it can have ATTRIBUTE_PRINTF. */
139 extern void fnotice (FILE *, const char *, ...)
143 extern bool exit_after_options;
145 extern void print_version (FILE *, const char *);
147 /* Handle -d switch. */
148 extern void decode_d_option (const char *);
150 /* Functions used to get and set GCC's notion of in what directory
151 compilation was started. */
153 extern const char *get_src_pwd (void);
154 extern bool set_src_pwd (const char *);
159 /* Don't suppress warnings from system headers. -Wsystem-headers. */
161 extern bool warn_system_headers;
165 extern bool warnings_are_errors;
167 /* Nonzero for -pedantic switch: warn about anything
168 that standard C forbids. */
170 /* Temporarily suppress certain warnings.
171 This is set while reading code from a system header file. */
173 extern int in_system_header;
175 /* Nonzero means `char' should be signed. */
177 extern int flag_signed_char;
179 /* Nonzero means change certain warnings into errors.
180 Usually these are warnings about failure to conform to some standard. */
182 extern int flag_pedantic_errors;
184 /* Don't print warning messages. -w. */
186 extern bool inhibit_warnings;
193 /* Nonzero means don't output line number information. */
195 extern char flag_no_line_commands;
197 /* Nonzero causes -E output not to be done, but directives such as
198 #define that have side effects are still obeyed. */
200 extern char flag_no_output;
202 /* Nonzero means dump macros in some fashion; contains the 'D', 'M' or
203 'N' of the command line switch. */
205 extern char flag_dump_macros;
207 /* 0 means we want the preprocessor to not emit line directives for
208 the current working directory. 1 means we want it to do it. -1
209 means we should decide depending on whether debugging information
210 is being emitted or not. */
212 extern int flag_working_directory;
214 /* Nonzero means warn about usage of long long when `-pedantic'. */
216 extern int warn_long_long;
218 extern int sdcpp_common_handle_option (size_t code, const char *arg, int value);
219 extern bool sdcpp_common_missing_argument (const char *opt, size_t code);
220 extern unsigned int sdcpp_common_init_options (unsigned int, const char **);
221 extern bool sdcpp_common_post_options (const char **);
222 extern bool sdcpp_common_init (void);
223 extern void sdcpp_common_finish (void);
225 /* Nonzero means pass #include lines through to the output. */
227 extern char flag_dump_includes;
229 /* In c-ppoutput.c */
230 extern void init_pp_output (FILE *);
231 extern void preprocess_file (cpp_reader *);
232 extern void pp_file_change (const struct line_map *);
233 extern void pp_dir_change (cpp_reader *, const char *);
238 extern struct cpp_reader* parse_in;
245 /* Define the overall contents of a tree node.
246 just to make diagnostic.c happy */
256 #define DECL_SOURCE_LOCATION(NODE) ((NODE)->decl.locus)
258 #endif /* __SDCPP_H */