Preprocessor defines

Discussion in 'C++' started by Pelle Beckman, Jul 2, 2005.

  1. Hi,

    This might be OT...

    Are there preprocessor defines in the C++ standard,
    such as __FILE__, __LINE__, __NAMESPACE__, __FUNCTION__, ec?
    If there is, were can I find a list?

    If there isn't, does anyone know of a good list
    for those defines under Gcc (3.4 <=)?


    -- Pelle
    Pelle Beckman, Jul 2, 2005
    #1
    1. Advertising

  2. Pelle Beckman

    Ian Guest

    Pelle Beckman wrote:
    > Hi,
    >
    > This might be OT...
    >
    > Are there preprocessor defines in the C++ standard,
    > such as __FILE__, __LINE__, __NAMESPACE__, __FUNCTION__, ec?
    > If there is, were can I find a list?
    >
    > If there isn't, does anyone know of a good list
    > for those defines under Gcc (3.4 <=)?
    >

    No, the first two are inherited from C, __func__ is defined as an
    identifier in C99.

    Other than that, look in the man pages.

    Ian
    Ian, Jul 2, 2005
    #2
    1. Advertising

  3. Pelle Beckman

    Alan Johnson Guest

    Pelle Beckman wrote:
    > Hi,
    >
    > This might be OT...
    >
    > Are there preprocessor defines in the C++ standard,
    > such as __FILE__, __LINE__, __NAMESPACE__, __FUNCTION__, ec?
    > If there is, were can I find a list?
    >
    > If there isn't, does anyone know of a good list
    > for those defines under Gcc (3.4 <=)?
    >
    >
    > -- Pelle


    __LINE__
    __FILE__
    __DATE__
    __TIME__
    __STDC__
    __cplusplus

    I think that is a complete list as defined by the standard (of course
    your implementation could define several more).

    -Alan
    Alan Johnson, Jul 2, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    3,394
    Brian Drummond
    Feb 24, 2006
  2. Jakob Simon-Gaarde

    Preprocessor concatination of defines

    Jakob Simon-Gaarde, Jul 1, 2004, in forum: C++
    Replies:
    4
    Views:
    442
    Jack Klein
    Jul 2, 2004
  3. Cronus
    Replies:
    1
    Views:
    668
    Paul Mensonides
    Jul 15, 2004
  4. theotyflos
    Replies:
    3
    Views:
    468
    Thomas Matthews
    Feb 19, 2004
  5. Replies:
    9
    Views:
    386
Loading...

Share This Page