<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hello Duncan<br>
<br>
You are right. I have managed to achieve the desired behavior by<br>
hacking the preprocessor code in the following way:<br>
1. when the preprocessor encounter an included file it tries to open it<br>
and if it was successful it remembers the full file name. <br>
2. I added one line of code, which makes it remembering the original
(short)<br>
file name instead of the full one.<br>
As a result the original (short) file name appears in the preprocessor
output.<br>
I believe the omniidl itself does not try to open the included files
and everything <br>
works as I desired. I believe this would not have any negative
implications to the<br>
IDL compiler. What do you think ?<br>
<br>
Below there is a patch:<br>
<br>
*** src/tool/omniidl/cxx/cccp/cccp.c Tue Jul 4 17:22:38 2000<br>
---
../working/online/omni/omni-05-00-00/src/tool/omniidl/cxx/cccp/cccp.c
Fri Mar 26 15:20:50 2004<br>
***************<br>
*** 4490,4495 ****<br>
--- 4490,4496 ----<br>
#endif /* VMS */<br>
f = open_include_file (fname, searchptr, importing, &inc);<br>
if (f != -1) {<br>
+ strcpy (fname, fbeg);<br>
if (bypass_slot && searchptr != first_bracket_include) {<br>
/* This is the first time we found this include file,<br>
and we found it after first_bracket_include.<br>
<br>
<br>
Duncan Grisby wrote:<br>
<blockquote type="cite"
cite="mid200403261219.i2QCJkl22248@grisby.dyndns.org">
<pre wrap="">On Friday 19 March, Serguei Kolos wrote:
</pre>
<blockquote type="cite">
<pre wrap="">1. file Test.idl contains the line:
#include <mydir/myidl.idl>
2. myidl.idl file is in the /home/myincludes/mydir directory
3. I'm executing the following command:
> omniidl -bcxx -Wbkeep_inc_path -I/home/myincludes TT.idl
4. and finally the generated TT.hh file contains the following statement:
#ifndef __myidl_hh_EXTERNAL_GUARD__
#define __myidl_hh_EXTERNAL_GUARD__
#include </home/myincludes/mydir/myidl.hh>
#endif
5. I would expect to have here the following:
#ifndef __myidl_hh_EXTERNAL_GUARD__
#define __myidl_hh_EXTERNAL_GUARD__
#include <mydir/myidl.hh>
#endif
</pre>
</blockquote>
<pre wrap=""><!---->
People have mentioned this before. I agree that it would be useful if
it behaved the way you suggest. Unfortunately, omniidl never gets to
see the original #include <mydir/myidl.idl> since it is handled by the
C pre-processor. By the time omniidl sees it, the directive output by
the pre-processor has the full file path. There's no easy way for
omniidl to figure out what it was originally.
Cheers,
Duncan.
</pre>
</blockquote>
</body>
</html>