Ticket #8874: 0001-SoundConsumer.cpp-fix-debug-macros-compiling-in-rele.patch

File 0001-SoundConsumer.cpp-fix-debug-macros-compiling-in-rele.patch, 1.6 KB (added by jessicah, 12 years ago)

Fixes compile errors in release mode

  • src/kits/media/SoundConsumer.cpp

    From 0855477c7d5de7b57ab4a2587f8604dc919dcd4d Mon Sep 17 00:00:00 2001
    From: Jessica Hamilton <jessica.l.hamilton@gmail.com>
    Date: Sun, 12 Aug 2012 18:45:24 +1200
    Subject: [PATCH] SoundConsumer.cpp: fix debug macros compiling in release mode
    
    ---
     src/kits/media/SoundConsumer.cpp |   11 ++++-------
     1 files changed, 4 insertions(+), 7 deletions(-)
    
    diff --git a/src/kits/media/SoundConsumer.cpp b/src/kits/media/SoundConsumer.cpp
    index 41c49b5..a3498f2 100644
    a b namespace BPrivate {  
    3535//  other such debugging aids. By contrast, DEBUG turns on extra debugging
    3636//  in some programs.
    3737#if !NDEBUG
    38 #define FPRINTF fprintf
    39 #else
    40 #define FPRINTF (void)
     38#define TRACE_SOUNDCONSUMER
    4139#endif
    4240
    4341//  Comment out the FPRINTF part of these lines to reduce verbiage.
    4442//  Enabling MESSAGE will kill performance on slower machines, because it
    4543//  prints for each message received (including each buffer).
    46 #define TRACE_SOUNDCONSUMER
    4744#ifdef TRACE_SOUNDCONSUMER
    48 #define NODE FPRINTF
    49 #define MESSAGE FPRINTF
     45#define NODE fprintf
     46#define MESSAGE fprintf
    5047#else
    5148#define NODE(x...)
    5249#define MESSAGE(x...)
    SoundConsumer::ServiceThread()  
    628625                Notify(B_OP_TIMED_OUT, timeout);
    629626        } else {
    630627            //  Other errors are bad.
    631             FPRINTF(stderr, "SoundConsumer: error %#010lx\n", err);
     628            MESSAGE(stderr, "SoundConsumer: error %#010lx\n", err);
    632629            bad++;
    633630            //  If we receive three bad reads with no good messages inbetween,
    634631            //  things are probably not going to improve (like the port