lkml.org 
[lkml]   [2005]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: asm-offsets.h is generated in the source tree
    Date
    On Mon, Sep 12, 2005 at 09:15:25PM +0200, Sam Ravnborg wrote:
    > o Use some magic define trick like:
    > - #include "ARCHDIR##foo.h"
    > - I cannot recall correct syntax but something like this is doable

    The syntax for that is one of the following:

    # define STR(x) #x
    # define XSTR(x) STR(x)

    # define SOME_ARCH_DIR foo/bar
    # define STRING_INCLUDE(path) XSTR(SOME_ARCH_DIR/path)
    # define ANGLE_INCLUDE(path) <SOME_ARCH_DIR/path>

    Then:
    # include STRING_INCLUDE(baz.h) ==> # include "foo/bar/baz.h"
    # include ANGLE_INCLUDE(baz.h) ==> # include <foo/bar/baz.h>

    I'm not sure what GCC version these were first supported in, but I
    would try to stay away from them as a matter of principle. They're
    ugly and quite hard to read/understand. If there were no other way,
    I might use those, but since there probably is... I dunno about
    you, but those are some really icky constructions.

    Cheers,
    Kyle Moffett

    --
    Premature optimization is the root of all evil in programming
    -- C.A.R. Hoare



    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-09-13 08:52    [W:0.024 / U:0.860 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site