Bug report


#1

Hi guys,

two bugs:

on mac START_JUCE_APPLICATION macro
is missing JUCE_NAMESPACE::

juce_DeclareSingleton
is missing JUCE_NAMESPACE::

s it doesn t compile when defining
DONT_SET_USING_JUCE_NAMESPACE

If there is a better way to report bugs, let me know

Thanks,


#2

Ah, right - thanks for letting me know. I’ve checked-in some fixes for those now…


#3

I experience the same with juce_isRunningUnderDebugger

adding the JUCE_NAMESPACE like that

      #define jassertfalse              { juce_LogCurrentAssertion; if (JUCE_NAMESPACE::juce_isRunningUnderDebugger()) { __asm int 3 } }
    #endif
  #elif defined (JUCE_MAC)
    #define jassertfalse                { juce_LogCurrentAssertion; if (JUCE_NAMESPACE::juce_isRunningUnderDebugger()) Debugger(); }
  #elif defined (JUCE_GCC) || defined (JUCE_LINUX)
    #define jassertfalse                { juce_LogCurrentAssertion; if (JUCE_NAMESPACE::juce_isRunningUnderDebugger()) asm("int $3"); }
  #endif

instead of this

      #define jassertfalse              { juce_LogCurrentAssertion; if (juce_isRunningUnderDebugger()) { __asm int 3 } }
    #endif
  #elif defined (JUCE_MAC)
    #define jassertfalse                { juce_LogCurrentAssertion; if (juce_isRunningUnderDebugger()) Debugger(); }
  #elif defined (JUCE_GCC) || defined (JUCE_LINUX)
    #define jassertfalse                { juce_LogCurrentAssertion; if (juce_isRunningUnderDebugger()) asm("int $3"); }
  #endif

solves the problem


#4

Jules,

you should change that line:

#elif defined (JUCE_GCC) || defined (JUCE_LINUX)
    #define jassertfalse                { juce_LogCurrentAssertion; if (JUCE_NAMESPACE::juce_isRunningUnderDebugger()) asm("int $3"); }
  #endif 

to

#elif defined (JUCE_GCC) || defined (JUCE_LINUX)
    #define jassertfalse                { juce_LogCurrentAssertion; if (JUCE_NAMESPACE::juce_isRunningUnderDebugger()) kill(0, SIGTRAP); }
  #endif 

as it is the correct way to break into the debugger under Posix. (asm trick is correct for x86 but not for any other architecture, like PPC or ARM9).
The debugger always catch sigtrap anyway as it’s the way it does for its own breakpoints.

BTW, it should even work on MacOS, so it even simplifies the macro to only 2 cases ( WIN32 and POSIX )


#5

Oh, and under Win32 you should use DebugBreak() instead of asm int 3
Under WinCE (ARM9 in most case), the former will compile, while the latter will not.


#6

Good suggestion - thanks! (I assume it’s ok to also use that trick on old PPC macs?)


#7