This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/29245] New: no way to safely attempt an #include which may fail
- From: "acahalan at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Sep 2006 00:06:12 -0000
- Subject: [Bug preprocessor/29245] New: no way to safely attempt an #include which may fail
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Over the years, many gross hacks have been created to determine what header
files are available. Just as #ifdef is the solution to discovering if something
is defined, there should be a built-in solution for discovering if something is
successfully included. Ultimately this should be presented to the ISO for
standardization as part of both C and C++.
There are many possible ways this could work.
Idea #1
#tryinclude <foo.h> FOO // defines foo if include worked
Idea #2
#ifinclude <foo.h>
#endif
--
Summary: no way to safely attempt an #include which may fail
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: acahalan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29245