|
- /*
- ==============================================================================
-
- This file is part of the JUCE library - "Jules' Utility Class Extensions"
- Copyright 2004-9 by Raw Material Software Ltd.
-
- ------------------------------------------------------------------------------
-
- JUCE can be redistributed and/or modified under the terms of the GNU General
- Public License (Version 2), as published by the Free Software Foundation.
- A copy of the license is included in the JUCE distribution, or can be found
- online at www.gnu.org/licenses.
-
- JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- ------------------------------------------------------------------------------
-
- To release a closed-source product which uses JUCE, commercial licenses are
- available: visit www.rawmaterialsoftware.com/juce for more information.
-
- ==============================================================================
- */
-
- // (This file gets included by juce_mac_NativeCode.mm, rather than being
- // compiled on its own).
- #ifdef JUCE_INCLUDED_FILE
-
- //==============================================================================
- void Logger::outputDebugString (const String& text) throw()
- {
- fputs (text.toUTF8(), stderr);
- fputs ("\n", stderr);
- }
-
- void Logger::outputDebugPrintf (const tchar* format, ...) throw()
- {
- String text;
- va_list args;
- va_start (args, format);
- text.vprintf (format, args);
- outputDebugString (text);
- }
-
- bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw()
- {
- static char testResult = 0;
-
- if (testResult == 0)
- {
- struct kinfo_proc info;
- int m[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() };
- size_t sz = sizeof (info);
- sysctl (m, 4, &info, &sz, 0, 0);
- testResult = ((info.kp_proc.p_flag & P_TRACED) != 0) ? 1 : -1;
- }
-
- return testResult > 0;
- }
-
- bool JUCE_CALLTYPE Process::isRunningUnderDebugger() throw()
- {
- return juce_isRunningUnderDebugger();
- }
-
-
- #endif
|