public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Fixincludes permanence & questions on cross compilers
@ 2012-05-23 16:53 rbmj
  2012-05-23 17:27 ` Jonathan Wakely
  0 siblings, 1 reply; 14+ messages in thread
From: rbmj @ 2012-05-23 16:53 UTC (permalink / raw)
  To: gcc-help

Hi all,

Two questions:

1.  Are fixincludes hacks only active during build-time (e.g. they do 
not replace the actual file) or are they permanent?  If they are only 
temporary/local to gcc, but they need to be permanent, is there a way to 
specify this?

2.  On cross compilers, fixincludes does not appear (to my uneducated 
eye) to be applied to my headers (then again, I may have written the 
hacks wrong) located in sys-include.  Does fixincludes not affect 
headers in sys-include or am I not looking hard enough?

If somebody can explain in a bit more detail how fixincludes works (I 
read the README but it only defines the formatting), please do.

The hacks I'm trying to apply are at the end of this email, if it helps.

Thanks,

Robert Mason

/*
  *  Wrap VxWorks ioctl to keep everything pretty
  */
fix = {
     hackname    = vxworks_ioctl_macro;
     files       = ioLib.h;
     test        = " -r vxWorks.h ";

     c_fix       = format;
     c_fix_arg   = "%0\n"
         "#define ioctl(fd, func, arg) ((ioctl)((fd), (func), 
((int)(arg))))\n";
     c_fix_arg   = "extern[\t ]+int[\t ]+ioctl[\t ]*\([\t ,[:alnum:]]\);";

     test_text   = "`touch vxWorks.h`"
         "extern int ioctl ( int asdf1234, int jkl, int qwerty ) ;";
};

/*
  *  Work around same-named gcc header regs.h in taskLib.h on VxWorks
  */
fix = {
     hackname    = vxworks_tasklib_regs;
     files       = taskLib.h;
     test        = " -r vxWorks.h ";

     select      = "#[\t ]*include[\t ]+<regs.h>";
     c_fix       = format;
     c_fix_arg   = "#include <arch/../regs.h>";

     test_text   = "`touch vxWorks.h`"
         "#include <regs.h>\n";
};

/*
  *  This hack makes makes unistd.h more POSIX-compliant on VxWorks
  */
fix = {
     hackname    = vxworks_unistd;
     files       = unistd.h;
     test        = " -r vxWorks.h ";

     select      = "#[\t ]*include[\t ]+<vxWorks.h>";
     c_fix       = format;
     c_fix_arg   = "%0\n#include <ioLib.h>\n"
         "#ifndef STDIN_FILENO\n"
         "#define STDIN_FILENO 0\n"
         "#endif\n"
         "#ifndef STDOUT_FILENO\n"
         "#define STDOUT_FILENO 1\n"
         "#endif\n"
         "#ifndef STDERR_FILENO\n"
         "#define STDERR_FILENO 2\n"
         "#endif\n";

     test_text   = "`touch vxWorks.h`"
         "#include <vxWorks.h>\n";
};

/*
  *  This hack makes write const-correct on VxWorks
  */
fix = {
     hackname    = vxworks_write_const;
     files       = ioLib.h;
     test        = " -r vxWorks.h ";

     c_fix       = format;
     c_fix_arg   = "extern int  write (int, const char*, size_t);";
     c_fix_arg   = "extern[\t ]+int[\t ]+write[\t ]*\("
         "[\t ]*int[\t ]*,"
         "[\t ]*char[\t ]*\*[\t ]*,"
         "[\t ]*size_t[\t ]*\)[\t ]*;";

     test_text   = "`touch vxWorks.h`"
         "extern int write ( int , char * , size_t ) ;";
};

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-06-01 19:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-23 16:53 Fixincludes permanence & questions on cross compilers rbmj
2012-05-23 17:27 ` Jonathan Wakely
2012-05-23 18:04   ` rbmj
2012-05-25 12:08     ` Why is fixincludes not doing anything? (was: Re: Fixincludes permanence & questions on cross compilers) rbmj
2012-05-25 14:00       ` Ian Lance Taylor
2012-05-25 14:24         ` Why is fixincludes not doing anything? rbmj
2012-05-25 23:19           ` Ian Lance Taylor
2012-05-26 19:58             ` rbmj
     [not found]             ` <4FC128C8.1060604@verizon.net>
     [not found]               ` <mcrr4u6iufn.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
2012-05-26 20:54                 ` rbmj
2012-05-27  6:08                   ` rbmj
2012-05-29 19:13             ` rbmj
2012-05-29 22:48               ` Ian Lance Taylor
2012-06-01 17:32                 ` rbmj
2012-06-01 19:44                   ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).