CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Doubt

  1. #1
    Join Date
    Oct 2001
    Posts
    745

    Doubt

    In Windows if I want to set #define statements,I can give it in the preprocessor definition.
    Where will I give the #define which I defined for Linux if I want to compile the linux code under Linux

    for Eg:-

    #ifdefine WIN32

    #elif _Linux

    #endif

    where Should I give the "_Linux" in Linux.
    Thanks..

  2. #2
    Join Date
    Apr 1999
    Location
    Altrincham, England
    Posts
    4,470
    It's more likely that the compiler will set something that you can use. All (or most) compilers will implicitly declare macros that you can check for in conditional compilations. Look in the help for your particular compiler (probably under "pre-defined macros" or similar).
    Correct is better than fast. Simple is better than complex. Clear is better than cute. Safe is better than insecure.
    --
    Sutter and Alexandrescu, C++ Coding Standards

    Programs must be written for people to read, and only incidentally for machines to execute.

    --
    Harold Abelson and Gerald Jay Sussman

    The cheapest, fastest and most reliable components of a computer system are those that aren't there.
    -- Gordon Bell


  3. #3
    Join Date
    Jun 2002
    Location
    Germany
    Posts
    1,557
    The GNU compilers set __GNUC__ if you're using GNU.
    Chris.
    You're gonna go blind staring into that box all day.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured