1 /*****************************************************************************/ 2 // Copyright 2006-2012 Adobe Systems Incorporated 3 // All Rights Reserved. 4 // 5 // NOTICE: Adobe permits you to use, modify, and distribute this file in 6 // accordance with the terms of the Adobe license agreement accompanying it. 7 /*****************************************************************************/ 8 9 /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_flags.h#5 $ */ 10 /* $DateTime: 2012/07/31 22:04:34 $ */ 11 /* $Change: 840853 $ */ 12 /* $Author: tknoll $ */ 13 14 /** \file 15 * Conditional compilation flags for DNG SDK. 16 * 17 * All conditional compilation macros for the DNG SDK begin with a lowercase 'q'. 18 */ 19 20 /*****************************************************************************/ 21 22 #ifndef __dng_flags__ 23 #define __dng_flags__ 24 25 /*****************************************************************************/ 26 27 /// \def qMacOS 28 /// 1 if compiling for Mac OS X. 29 30 /// \def qWinOS 31 /// 1 if compiling for Windows. 32 33 // Make sure qMacOS and qWinOS are defined. 34 35 #if !defined(qMacOS) || !defined(qWinOS) 36 #include "RawEnvironment.h" 37 #endif 38 39 #if !defined(qMacOS) || !defined(qWinOS) 40 #error Unable to figure out platform 41 #endif 42 43 /*****************************************************************************/ 44 45 // Platforms. 46 47 #ifndef qImagecore 48 #define qImagecore 0 49 #endif 50 51 #ifndef qiPhone 52 #define qiPhone 0 53 #endif 54 55 #ifndef qiPhoneSimulator 56 #define qiPhoneSimulator 0 57 #endif 58 59 #ifndef qAndroid 60 #define qAndroid 0 61 #endif 62 63 #ifndef qAndroidArm7 64 #define qAndroidArm7 0 65 #endif 66 67 /*****************************************************************************/ 68 69 // Establish WIN32 and WIN64 definitions. 70 71 #if defined(_WIN32) && !defined(WIN32) 72 #define WIN32 1 73 #endif 74 75 #if defined(_WIN64) && !defined(WIN64) 76 #define WIN64 1 77 #endif 78 79 /*****************************************************************************/ 80 81 /// \def qDNGDebug 82 /// 1 if debug code is compiled in, 0 otherwise. Enables assertions and other debug 83 /// checks in exchange for slower processing. 84 85 // Figure out if debug build or not. 86 87 #ifndef qDNGDebug 88 89 #if defined(Debug) 90 #define qDNGDebug Debug 91 92 #elif defined(_DEBUG) 93 #define qDNGDebug _DEBUG 94 95 #else 96 #define qDNGDebug 0 97 98 #endif 99 #endif 100 101 /*****************************************************************************/ 102 103 // Figure out byte order. 104 105 /// \def qDNGBigEndian 106 /// 1 if this target platform is big endian (e.g. PowerPC Macintosh), else 0. 107 /// 108 /// \def qDNGLittleEndian 109 /// 1 if this target platform is little endian (e.g. x86 processors), else 0. 110 111 #ifndef qDNGBigEndian 112 113 #if defined(qDNGLittleEndian) 114 #define qDNGBigEndian !qDNGLittleEndian 115 116 #elif defined(__POWERPC__) 117 #define qDNGBigEndian 1 118 119 #elif defined(__INTEL__) 120 #define qDNGBigEndian 0 121 122 #elif defined(_M_IX86) 123 #define qDNGBigEndian 0 124 125 #elif defined(_M_X64) || defined(__amd64__) 126 #define qDNGBigEndian 0 127 128 #elif defined(__LITTLE_ENDIAN__) 129 #define qDNGBigEndian 0 130 131 #elif defined(__BIG_ENDIAN__) 132 #define qDNGBigEndian 1 133 134 #elif defined(_ARM_) || defined(__ARM_NEON) || defined(__mips__) 135 #define qDNGBigEndian 0 136 137 #else 138 139 #ifndef qXCodeRez 140 #error Unable to figure out byte order. 141 #endif 142 143 #endif 144 #endif 145 146 #ifndef qXCodeRez 147 148 #ifndef qDNGLittleEndian 149 #define qDNGLittleEndian !qDNGBigEndian 150 #endif 151 152 #endif 153 154 /*****************************************************************************/ 155 156 /// \def qDNG64Bit 157 /// 1 if this target platform uses 64-bit addresses, 0 otherwise. 158 159 #ifndef qDNG64Bit 160 161 #if qMacOS || qLinux 162 163 #ifdef __LP64__ 164 #if __LP64__ 165 #define qDNG64Bit 1 166 #endif 167 #endif 168 169 #elif qWinOS 170 171 #ifdef WIN64 172 #if WIN64 173 #define qDNG64Bit 1 174 #endif 175 #endif 176 177 #endif 178 179 #ifndef qDNG64Bit 180 #define qDNG64Bit 0 181 #endif 182 183 #endif 184 185 /*****************************************************************************/ 186 187 /// \def qDNGThreadSafe 188 /// 1 if target platform has thread support and threadsafe libraries, 0 otherwise. 189 190 #ifndef qDNGThreadSafe 191 #define qDNGThreadSafe (qMacOS || qWinOS) 192 #endif 193 194 /*****************************************************************************/ 195 196 /// \def qDNGValidateTarget 197 /// 1 if dng_validate command line tool is being built, 0 otherwise. 198 199 #ifndef qDNGValidateTarget 200 #define qDNGValidateTarget 0 201 #endif 202 203 /*****************************************************************************/ 204 205 /// \def qDNGValidate 206 /// 1 if DNG validation code is enabled, 0 otherwise. 207 208 #ifndef qDNGValidate 209 #define qDNGValidate qDNGValidateTarget 210 #endif 211 212 /*****************************************************************************/ 213 214 /// \def qDNGPrintMessages 215 /// 1 if dng_show_message should use fprintf to stderr. 0 if it should use a platform 216 /// specific interrupt mechanism. 217 218 #ifndef qDNGPrintMessages 219 #define qDNGPrintMessages qDNGValidate 220 #endif 221 222 /*****************************************************************************/ 223 224 /// \def qDNGCodec 225 /// 1 to build the Windows Imaging Component Codec (e.g. for Vista). 226 227 #ifndef qDNGCodec 228 #define qDNGCodec 0 229 #endif 230 231 /*****************************************************************************/ 232 233 // Experimental features -- work in progress for Lightroom 4.0 and Camera Raw 7.0. 234 // Turn this off for Lightroom 3.x & Camera Raw 6.x dot releases. 235 236 #ifndef qDNGExperimental 237 #define qDNGExperimental 1 238 #endif 239 240 /*****************************************************************************/ 241 242 /// \def qDNGXMPFiles 243 /// 1 to use XMPFiles. 244 245 #ifndef qDNGXMPFiles 246 #define qDNGXMPFiles 1 247 #endif 248 249 /*****************************************************************************/ 250 251 /// \def qDNGXMPDocOps 252 /// 1 to use XMPDocOps. 253 254 #ifndef qDNGXMPDocOps 255 #define qDNGXMPDocOps (!qDNGValidateTarget) 256 #endif 257 258 /*****************************************************************************/ 259 260 /// \def qDNGUseLibJPEG 261 /// 1 to use open-source libjpeg for lossy jpeg processing. 262 263 #ifndef qDNGUseLibJPEG 264 #define qDNGUseLibJPEG qDNGValidateTarget 265 #endif 266 267 /*****************************************************************************/ 268 269 #endif 270 271 /*****************************************************************************/ 272