home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.2 KB | 124 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: SLPriDeb.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWFound.hpp"
-
- // Need to include first so that FW_DEBUG is properly defined
-
- #ifndef SLPRIDEB_H
- #include "SLPriDeb.h"
- #endif
-
- #ifdef FW_DEBUG
-
- #ifndef FWPRISTR_H
- #include "FWPriStr.h"
- #endif
-
- #ifndef FWPRIMEM_H
- #include "FWPriMem.h"
- #endif
-
- #include <stdio.h>
-
- #if defined(FW_BUILD_MAC) && !defined(__TYPES__)
- #include <Types.h>
- #endif
-
- #if defined(FW_BUILD_WIN) && !defined(_INC_WINDOWS)
- #include <Windows.h>
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment FWCommon
- #endif
-
- //----------------------------------------------------------------------------------------
- // FW_PrivDebugger
- //----------------------------------------------------------------------------------------
- FW_EXPORT void FW_PrivDebugger()
- {
- // No try block necessary - Do not throw
- #if defined(FW_BUILD_WIN)
- ::DebugBreak();
- #elif defined(FW_BUILD_MAC)
- ::Debugger();
- #endif
- }
-
- #if defined(FW_BUILD_MAC) && !defined(CGLUESUPPORTED)
- //----------------------------------------------------------------------------------------
- // fwctop
- //----------------------------------------------------------------------------------------
-
- static void fwctop(char* s)
- {
- int len = FW_PrimitiveStringLength(s);
- FW_PrimitiveCopyMemory(s, s+1, len);
- s[0] = len;
- }
-
- //----------------------------------------------------------------------------------------
- // fwptoc
- //----------------------------------------------------------------------------------------
-
- static void fwptoc(char* s)
- {
- int len = s[0];
- FW_PrimitiveCopyMemory(s+1, s, len);
- s[len] = 0;
- }
-
- //----------------------------------------------------------------------------------------
- // debugstr
- //----------------------------------------------------------------------------------------
- static void debugstr(const char *message)
- {
- fwctop((char*) message);
- DebugStr((const unsigned char*) message);
- fwptoc((char*) message);
- }
- #endif
-
- //----------------------------------------------------------------------------------------
- // FW_PrivDebugMessage
- //----------------------------------------------------------------------------------------
- FW_EXPORT void FW_PrivDebugMessage(const char *message)
- {
- // No try block necessary - Do not throw
- #if defined(FW_BUILD_WIN)
- char crlf[3] = {0x0D, 0x0A, 0x00};
- ::OutputDebugString(message);
- ::OutputDebugString(crlf);
- ::DebugBreak();
- #elif defined(FW_BUILD_MAC)
- ::debugstr(message);
- #endif
- }
-
- #else
-
- //----------------------------------------------------------------------------------------
- // FW_PrivDebugMessage
- //----------------------------------------------------------------------------------------
- FW_EXPORT void FW_PrivDebugMessage(const char *message)
- {
- FW_UNUSED(message);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivDebugger
- //----------------------------------------------------------------------------------------
- FW_EXPORT void FW_PrivDebugger()
- {
- }
-
- #endif
-
-