availability of "typeof" keyword - HP UX

This is a discussion on availability of "typeof" keyword - HP UX ; Hi All, How does a user of HP aC++ determines whether the typeof (or __typeof__) keyword is available? Is there any symbol defined that can be tested? For example Intel defines __GNUC__, and Comeau defines __GNUG__. These symbols can be ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: availability of "typeof" keyword

  1. availability of "typeof" keyword

    Hi All,

    How does a user of HP aC++ determines whether the typeof (or
    __typeof__) keyword is available? Is there any symbol defined that can
    be tested?

    For example Intel defines __GNUC__, and Comeau defines __GNUG__. These
    symbols can be tested to decide whether or not typeof can be used. Is
    there anything similar in HP aC++?

    TIA.

    Regards,
    Arkadiy


  2. Re: availability of "typeof" keyword

    Arkadiy wrote: not in a
    : How does a user of HP aC++ determines whether the typeof (or
    : __typeof__) keyword is available? Is there any symbol defined that can
    : be tested?

    aC++ on PA doesn't support it. But PA HPC does, at least with __HP_cc=111108.

    : Is there anything similar in HP aC++?

    For aCC6, you can use -Agcc to support it.
    For A.06.05, _HP_GNUC_COMPATIBLE is defined with that option.

  3. Re: availability of "typeof" keyword


    Marty Freitas wrote:
    > Arkadiy wrote: not in a
    > : How does a user of HP aC++ determines whether the typeof (or
    > : __typeof__) keyword is available? Is there any symbol defined that can
    > : be tested?
    >
    > aC++ on PA doesn't support it. But PA HPC does, at least with __HP_cc=111108.
    >
    > : Is there anything similar in HP aC++?
    >
    > For aCC6, you can use -Agcc to support it.
    > For A.06.05, _HP_GNUC_COMPATIBLE is defined with that option.


    So, is it safe to go like this for any version of aC++, regardless of
    what command-line options have been supplied:

    #ifdef _HP_GNUC_COMPATIBLE
    // can use typeof (or __typeof__?)
    #else
    // no typeof
    #endif

    Thanks,
    Arkadiy


  4. Re: availability of "typeof" keyword

    Arkadiy wrote:
    : is it safe to go like this for any version of aC++, regardless of
    : what command-line options have been supplied:

    Yes, but it may only be true for that version and that option.

    : #ifdef _HP_GNUC_COMPATIBLE
    : // can use typeof (or __typeof__?) // Yes.
    : #else

+ Reply to Thread