Fixincludes permanence & questions on cross compilers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ) ;";
};



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux