Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Relevant replacement documents include:
PublicUtility/CADebugPrintf.cpp
/* |
<codex> |
<abstract>CADebugPrintf.h</abstract> |
<\codex> |
*/ |
//================================================================================================== |
// Includes |
//================================================================================================== |
// Self Include |
#include "CADebugPrintf.h" |
#if DEBUG || CoreAudio_Debug |
#if TARGET_OS_WIN32 |
#include <stdarg.h> |
#include <stdio.h> |
#include <Windows.h> |
extern "C" |
int CAWin32DebugPrintf(char* inFormat, ...) |
{ |
char theMessage[1024]; |
va_list theArguments; |
va_start(theArguments, inFormat); |
_vsnprintf(theMessage, 1024, inFormat, theArguments); |
va_end(theArguments); |
OutputDebugString(theMessage); |
return 0; |
} |
#endif |
#if defined(CoreAudio_UseSideFile) |
#include <unistd.h> |
FILE* sDebugPrintfSideFile = NULL; |
extern "C" |
void OpenDebugPrintfSideFile() |
{ |
if(sDebugPrintfSideFile == NULL) |
{ |
char theFileName[1024]; |
snprintf(theFileName, sizeof(theFileName), CoreAudio_UseSideFile, getpid()); |
sDebugPrintfSideFile = fopen(theFileName, "a+"); |
DebugPrintfRtn(DebugPrintfFileComma "\n------------------------------\n"); |
} |
} |
#endif |
#endif |
Copyright © 2012 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2012-10-08