home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / mac / MacMemoryAllocator / src / MacTrace.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.9 KB  |  63 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /* 
  20.  * we can't ship the Library Manager, so only turn it on if people have the right libs,
  21.  * etc. To turn this back on, define DEBUG and set MAC_USE_LIBRARY_MANAGER to 1. Also,
  22.  * you need to add the LibraryManagerPPC.o file to the MemAllocator.mcp project so
  23.  * it will link.
  24.  */
  25. #define MAC_USE_LIBRARY_MANAGER 0
  26.  
  27. #if MAC_USE_LIBRARY_MANAGER
  28.     #include "LibraryManager.h"
  29.     #include "LibraryManagerUtilities.h"
  30. #endif
  31.  
  32. #include "xp_trace.h"
  33.  
  34. void FE_Trace(const char *message) {
  35. #ifdef DEBUG
  36.     #if MAC_USE_LIBRARY_MANAGER
  37.                                 // This whole routine should be ifdef╒ed out, but 
  38.                                 // we don't know who depends on it & it╒s too late 
  39.                                 // for that foolishness in 4.x.  bjones
  40.         Trace("%s", message);
  41.     #else
  42.         #pragma unused(message)
  43.     #endif
  44. #else
  45. #pragma unused(message)
  46. #endif
  47. }
  48.  
  49. void XP_TraceInit(void) {
  50. #ifdef DEBUG
  51. #if MAC_USE_LIBRARY_MANAGER
  52.     // Needed by ASLM.  Will be called during startup.  Must be supplied, see LibraryMangaerUtilities.h
  53.     OSErr    err;
  54.  
  55.     err = InitLibraryManager(0, kTempZone, kNormalMemory);
  56.     if (err == noErr) {
  57.         Trace("Here's XP_Trace!\n\n");
  58.     }
  59. #endif
  60. #endif
  61. }
  62.  
  63.