Thread: make use of ifdef

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    269

    make use of ifdef

    In this project, there's these lines of code

    Code:
    #ifdef DEBUG
                     fprintf(stderr, "add filter failed\n");
    #endif
    How do I actually set it so that these DEBUG things trigger?
    In the same file, at the top, would I just do
    Code:
    #define DEBUG
    ?

  2. #2
    Registered User
    Join Date
    Oct 2010
    Posts
    107
    Yes.

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Yes. Another way is via the command line (well, for most compilers, anyway). For example, with GCC you can use the -D switch (ie: -DDEBUG).
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    269
    Quote Originally Posted by Sebastiani View Post
    Yes. Another way is via the command line (well, for most compilers, anyway). For example, with GCC you can use the -D switch (ie: -DDEBUG).
    ah, gotcha.. that's something what I was looking for. thank you very muhc!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to make a Packet sniffer/filter?
    By shown in forum C++ Programming
    Replies: 2
    Last Post: 02-22-2009, 09:51 PM
  2. "Cannot make pipe"
    By crepincdotcom in forum C Programming
    Replies: 5
    Last Post: 08-16-2004, 12:43 PM
  3. HELP!wanting to make full screen game windowed
    By rented in forum Game Programming
    Replies: 3
    Last Post: 06-11-2004, 04:19 AM
  4. make all rule
    By duffy in forum C Programming
    Replies: 9
    Last Post: 09-11-2003, 01:05 PM
  5. Replies: 6
    Last Post: 04-20-2002, 06:35 PM