AAX SDK  2.1.1
Avid Audio Extensions Development Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AAX_Assert.h
Go to the documentation of this file.
1 /*================================================================================================*/
2 /*
3  *
4  * Copyright 2013 by Avid Technology, Inc.
5  * All rights reserved.
6  *
7  * CONFIDENTIAL: This document contains confidential information. Do not
8  * read or examine this document unless you are an Avid Technology employee
9  * or have signed a non-disclosure agreement with Avid Technology which protects
10  * the confidentiality of this document. DO NOT DISCLOSE ANY INFORMATION
11  * CONTAINED IN THIS DOCUMENT TO ANY THIRD-PARTY WITHOUT THE PRIOR WRITTEN CONSENT
12  * OF Avid Technology, INC.
13  *
14  */
15 
49 #ifndef AAX_ASSERT_H
50 #define AAX_ASSERT_H
51 
52 #include "AAX_Enums.h"
53 
54 
124 #ifdef _TMS320C6X // TI-only
125 
126  #ifndef TI_SHELL_TRACING_H
127  #include "TI_Shell_Tracing.h"
128  #endif
129 
130  typedef AAX_ETracePriorityDSP EAAX_Trace_Priority;
131 
132  #define kAAX_Trace_Priority_None AAX_eTracePriorityDSP_None
133  #define kAAX_Trace_Priority_High AAX_eTracePriorityDSP_High
134  #define kAAX_Trace_Priority_Normal AAX_eTracePriorityDSP_Normal
135  #define kAAX_Trace_Priority_Low AAX_eTracePriorityDSP_Low
136 
137  //Note that the Message provided to AAX_TRACE must be a cons string available for indefinite time
138  // because sending it to the host is done asynchronously.
139  #define AAX_TRACE_RELEASE( ... ) TISHELLTRACE( __VA_ARGS__ )
140 
141  #define _STRINGIFY(x) #x
142  #define _TOSTRING(x) _STRINGIFY(x)
143 
144  #if defined(_DEBUG)
145  #define AAX_ASSERT( condition ) \
146  { \
147  if( ! (condition) ) _DoTrace( AAX_eTracePriorityDSP_Assert, \
148  CAT(CAT( CAT(__FILE__, ":"), _TOSTRING(__LINE__) ) , CAT(" failed: ", #condition) ) );\
149  }
150 
151  #define AAX_TRACE( ... ) TISHELLTRACE( __VA_ARGS__ )
152 
153  #else
154  #define AAX_ASSERT( condition ) do { ; } while (0)
155  #define AAX_TRACE( ... ) do { ; } while (0)
156  #endif
157 
158 #else // Host:
159 
160  #ifndef AAX_CHOSTSERVICES_H
161  #include "AAX_CHostServices.h"
162  #endif
163 
165 
166  #define kAAX_Trace_Priority_None AAX_eTracePriorityHost_None
167  #define kAAX_Trace_Priority_High AAX_eTracePriorityHost_High
168  #define kAAX_Trace_Priority_Normal AAX_eTracePriorityHost_Normal
169  #define kAAX_Trace_Priority_Low AAX_eTracePriorityHost_Low
170 
171 
172  #if defined(_DEBUG)
173  #define AAX_ASSERT( condition ) \
174  { \
175  if( ! ( condition ) ) { \
176  AAX_CHostServices::Assert( __FILE__, __LINE__, #condition ); \
177  } \
178  };
179 
180  #define AAX_TRACE( iPriority, ... ) \
181  { \
182  AAX_CHostServices::Trace ( iPriority, __VA_ARGS__ ); \
183  };
184 
185  #else
186  #define AAX_ASSERT( condition ) do { ; } while (0)
187  #define AAX_TRACE( iPriority, ... ) do { ; } while (0)
188  #endif
189 
190  //Note that the Message provided to AAX_TRACE must be a const string available for indefinite time
191  // because sending it to the host is done asynchronously.
192  #define AAX_TRACE_RELEASE( iPriority, ... ) \
193  { \
194  AAX_CHostServices::Trace ( iPriority, __VA_ARGS__ ); \
195  };
196 
197 #endif
198 
199 
200 #endif // include guard
201 // end of AAX_Assert.h
AAX_ETracePriorityHost
Platform-specific tracing priorities.
Definition: AAX_Enums.h:86
AAX_ETracePriorityDSP
Platform-specific tracing priorities.
Definition: AAX_Enums.h:100
AAX_ETracePriorityHost AAX_ETracePriority
Definition: AAX_Assert.h:164
Utility functions for byte-swapping. Used by AAX_CChunkDataParser.