summaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-04 00:18:54 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-04 00:18:54 +0000
commit065e625ba1ccfe56db01479a77d3a9afdf81a6b5 (patch)
tree52808307852a6d2e40b91f9dd8a1f85f701d9c10 /gcc/cpplib.h
parent861ae1b2c242d37294641a4fb2420cc299091e6f (diff)
downloadgcc-065e625ba1ccfe56db01479a77d3a9afdf81a6b5.tar.gz
Add framework support for darwin.
* c-incpath.c: Include target.h and machmode.h. (add_path): Use a consistent style for cpp_dir. Initialize p->construct to 0. (add_cpp_dir_path): New. (register_include_chains): Add use of extra_includes callback. (hook_void_int): Add. (target_c_incpath): Add. * c-incpath.h (add_cpp_dir_path): New. (target_c_incpath_s): Add. (target_c_incpath): Add. (C_INCPATH_INIT): Add. * c-opts.c (c_common_missing_argument, c_common_handle_option): Add -F argument processing. * c.opt: Add -F argument processing. * gcc.c (trad_capable_cpp): Add -F argument processing. * cppfiles.c (find_file_in_dir): Update to use construct callback. (search_path_exhausted, cpp_get_path, cpp_get_buffer, cpp_get_prev): New. (_cpp_find_file): Use search_path_exhausted. (make_cpp_dir): Initialize construct to 0. * cpplib.h (missing_header_cb cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New. (cpp_callbacks): Add missing_header (cpp_dir): Add construct. * target-def.h: (TARGET_OPTF): New. * hooks.c (hook_void_int, hook_void_charptr): Add. * hooks.h (hook_void_int, hook_void_charptr): Add. * Makefile.in (c-incpath.o) : Add $(TARGET_H) and $(MACHMODE_H) dependencies. * doc/invoke.texi (Darwin Options): Document -F. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Add. (TARGET_OPTF): Add. * fix-header.c (target_c_incpath): Add. * config/darwin-c.c: Add c-incpath.h include. (using_frameworks, find_subframework_file, find_subframework_header, add_system_framework_path, frameworks_in_use, num_frameworks, max_frameworks, add_framework, find_framework, struct framework_header, framework_header_dirs, framework_construct_pathname, find_subframework_file, add_system_framework_path, add_framework_path, framework_defaults, darwin_register_frameworks, find_subframework_header): Add. * config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New. (TARGET_OPTION_TRANSLATE_TABLE): Add -framework support. (CPP_SPEC): Add __APPLE_CC__ support. * t-darwin (darwin-c.o): Add c-incpath.h dependency. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78875 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index dddbac2a451..c53375d4138 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -42,6 +42,7 @@ typedef struct cpp_callbacks cpp_callbacks;
typedef struct cpp_dir cpp_dir;
struct answer;
+struct _cpp_file;
/* The first three groups, apart from '=', can appear in preprocessor
expressions (+= and -= are used to indicate unary + and - resp.).
@@ -378,6 +379,14 @@ struct cpp_options
unsigned char stdc_0_in_system_headers;
};
+/* Callback for header lookup for HEADER, which is the name of a
+ source file. It is used as a method of last resort to find headers
+ that are not otherwise found during the normal include processing.
+ The return value is the malloced name of a header to try and open,
+ if any, or NULL otherwise. This callback is called only if the
+ header is otherwise unfound. */
+typedef const char *(*missing_header_cb)(cpp_reader *, const char *header);
+
/* Call backs to cpplib client. */
struct cpp_callbacks
{
@@ -399,6 +408,7 @@ struct cpp_callbacks
void (*def_pragma) (cpp_reader *, unsigned int);
int (*valid_pch) (cpp_reader *, const char *, int);
void (*read_pch) (cpp_reader *, const char *, int, const char *);
+ missing_header_cb missing_header;
};
/* Chain of directories to look for include files in. */
@@ -419,6 +429,12 @@ struct cpp_dir
platforms. A NULL-terminated array of (from, to) pairs. */
const char **name_map;
+ /* Routine to construct pathname, given the search path name and the
+ HEADER we are trying to find, return a constructed pathname to
+ try and open. If this is NULL, the constructed pathname is as
+ constructed by append_file_to_dir. */
+ char *(*construct) (const char *header, cpp_dir *dir);
+
/* The C front end uses these to recognize duplicated
directories in the search path. */
ino_t ino;
@@ -727,6 +743,10 @@ extern bool cpp_included (cpp_reader *, const char *);
extern void cpp_make_system_header (cpp_reader *, int, int);
extern bool cpp_push_include (cpp_reader *, const char *);
extern void cpp_change_file (cpp_reader *, enum lc_reason, const char *);
+extern const char *cpp_get_path (struct _cpp_file *);
+extern cpp_buffer *cpp_get_buffer (cpp_reader *);
+extern struct _cpp_file *cpp_get_file (cpp_buffer *);
+extern cpp_buffer *cpp_get_prev (cpp_buffer *);
/* In cpppch.c */
struct save_macro_data;