DocumentationOverviewBuilding ASL Documentation Library Wiki Docs Indices Browse Perforce More InfoRelease NotesWiki Site Search License Success Stories Contributors MediaDownloadPerforce Depots SupportASL SourceForge HomeMailing Lists Discussion Forums Report Bugs Suggest Features Contribute to ASL RSSShort-text newsFull-text news File releases Other Adobe ProjectsAdobe AirAdobe GIL Adobe Labs Adobe Media Gallery Adobe XMP Tamarin project (Mozilla Foundation) Other ResourcesBoostRIAForge SGI STL |
dng_assertions.hGo to the documentation of this file.00001 /*****************************************************************************/ 00002 // Copyright 2006-2007 Adobe Systems Incorporated 00003 // All Rights Reserved. 00004 // 00005 // NOTICE: Adobe permits you to use, modify, and distribute this file in 00006 // accordance with the terms of the Adobe license agreement accompanying it. 00007 /*****************************************************************************/ 00008 00009 /* $Id: //mondo/workarea/stern/camera_raw/dng_sdk/source/dng_assertions.h#12 $ */ 00010 /* $DateTime: 2009/02/02 11:37:36 $ */ 00011 /* $Change: 537208 $ */ 00012 /* $Author: stern $ */ 00013 00018 /*****************************************************************************/ 00019 00020 #ifndef __dng_assertions__ 00021 #define __dng_assertions__ 00022 00023 /*****************************************************************************/ 00024 00025 #include "dng_exceptions.h" 00026 #include "dng_flags.h" 00027 00028 /*****************************************************************************/ 00029 00030 #if qDNGDebug 00031 00033 void dng_show_message (const char *s); 00034 00035 // Show a formatted error message. 00036 00037 void dng_show_message_f (const char *fmt, ...); 00038 00039 #endif 00040 00041 /*****************************************************************************/ 00042 00043 #ifndef DNG_ASSERT 00044 00045 #if qDNGDebug 00046 00051 00052 #define DNG_ASSERT(x,y) { if (!(x)) dng_show_message (y); } 00053 00054 #else 00055 00060 00061 #define DNG_ASSERT(x,y) 00062 00063 #endif 00064 #endif 00065 00066 /*****************************************************************************/ 00067 00068 #ifndef DNG_REQUIRE 00069 00070 #if qDNGDebug 00071 00076 00077 #define DNG_REQUIRE(condition,msg) \ 00078 do \ 00079 { \ 00080 \ 00081 if (!(condition)) \ 00082 { \ 00083 \ 00084 dng_show_message (msg); \ 00085 \ 00086 ThrowProgramError (msg); \ 00087 \ 00088 } \ 00089 \ 00090 } \ 00091 while (0) 00092 00093 #else 00094 00099 00100 #define DNG_REQUIRE(condition,msg) \ 00101 do \ 00102 { \ 00103 \ 00104 if (!(condition)) \ 00105 { \ 00106 \ 00107 ThrowProgramError (msg); \ 00108 \ 00109 } \ 00110 \ 00111 } \ 00112 while (0) 00113 00114 #endif 00115 #endif 00116 00117 /*****************************************************************************/ 00118 00119 #ifndef DNG_REPORT 00120 00123 00124 #define DNG_REPORT(x) DNG_ASSERT (false, x) 00125 #endif 00126 00127 /*****************************************************************************/ 00128 00129 #endif 00130 00131 /*****************************************************************************/ |