this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at appkit 633 lines 27 kB view raw
1/* 2 * Copyright (c) 1993-2011 by Apple Inc.. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23 24/* 25 File: ConditionalMacros.h 26 27 Contains: Set up for compiler independent conditionals 28 29 Version: CarbonCore-769~1 30 31 Bugs?: For bug reports, consult the following page on 32 the World Wide Web: 33 34 http://developer.apple.com/bugreporter/ 35 36*/ 37#ifndef __CONDITIONALMACROS__ 38#define __CONDITIONALMACROS__ 39 40#include <Availability.h> 41/**************************************************************************************************** 42 UNIVERSAL_INTERFACES_VERSION 43 44 0x0400 --> version 4.0 (Mac OS X only) 45 0x0335 --> version 3.4 46 0x0331 --> version 3.3.1 47 0x0330 --> version 3.3 48 0x0320 --> version 3.2 49 0x0310 --> version 3.1 50 0x0301 --> version 3.0.1 51 0x0300 --> version 3.0 52 0x0210 --> version 2.1 53 This conditional did not exist prior to version 2.1 54****************************************************************************************************/ 55#define UNIVERSAL_INTERFACES_VERSION 0x0400 56/**************************************************************************************************** 57 58 All TARGET_* condtionals are set up by TargetConditionals.h 59 60****************************************************************************************************/ 61#include <TargetConditionals.h> 62 63 64 65 66/**************************************************************************************************** 67 68 PRAGMA_* 69 These conditionals specify whether the compiler supports particular #pragma's 70 71 PRAGMA_IMPORT - Compiler supports: #pragma import on/off/reset 72 PRAGMA_ONCE - Compiler supports: #pragma once 73 PRAGMA_STRUCT_ALIGN - Compiler supports: #pragma options align=mac68k/power/reset 74 PRAGMA_STRUCT_PACK - Compiler supports: #pragma pack(n) 75 PRAGMA_STRUCT_PACKPUSH - Compiler supports: #pragma pack(push, n)/pack(pop) 76 PRAGMA_ENUM_PACK - Compiler supports: #pragma options(!pack_enums) 77 PRAGMA_ENUM_ALWAYSINT - Compiler supports: #pragma enumsalwaysint on/off/reset 78 PRAGMA_ENUM_OPTIONS - Compiler supports: #pragma options enum=int/small/reset 79 80 81 FOUR_CHAR_CODE 82 This conditional is deprecated. It was used to work around a bug in one obscure compiler that did not pack multiple characters in single quotes rationally. 83 It was never intended for endian swapping. 84 85 FOUR_CHAR_CODE('abcd') - Convert a four-char-code to the correct 32-bit value 86 87 88 TYPE_* 89 These conditionals specify whether the compiler supports particular types. 90 91 TYPE_LONGLONG - Compiler supports "long long" 64-bit integers 92 TYPE_BOOL - Compiler supports "bool" 93 TYPE_EXTENDED - Compiler supports "extended" 80/96 bit floating point 94 TYPE_LONGDOUBLE_IS_DOUBLE - Compiler implements "long double" same as "double" 95 96 97 FUNCTION_* 98 These conditionals specify whether the compiler supports particular language extensions 99 to function prototypes and definitions. 100 101 FUNCTION_PASCAL - Compiler supports "pascal void Foo()" 102 FUNCTION_DECLSPEC - Compiler supports "__declspec(xxx) void Foo()" 103 FUNCTION_WIN32CC - Compiler supports "void __cdecl Foo()" and "void __stdcall Foo()" 104 105****************************************************************************************************/ 106 107#if defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__NEXT_CPP__) || defined(__MACOS_CLASSIC__)) 108 /* 109 gcc based compilers used on Mac OS X 110 */ 111 #define PRAGMA_IMPORT 0 112 #define PRAGMA_ONCE 0 113 114 #if __GNUC__ >= 4 115 #define PRAGMA_STRUCT_PACK 1 116 #define PRAGMA_STRUCT_PACKPUSH 1 117 #else 118 #define PRAGMA_STRUCT_PACK 0 119 #define PRAGMA_STRUCT_PACKPUSH 0 120 #endif 121 122 #if __LP64__ 123 #define PRAGMA_STRUCT_ALIGN 0 124 #else 125 #define PRAGMA_STRUCT_ALIGN 1 126 #endif 127 128 #define PRAGMA_ENUM_PACK 0 129 #define PRAGMA_ENUM_ALWAYSINT 0 130 #define PRAGMA_ENUM_OPTIONS 0 131 #define FOUR_CHAR_CODE(x) (x) 132 133 #define TYPE_EXTENDED 0 134 135 #ifdef __ppc__ 136 #ifdef __LONG_DOUBLE_128__ 137 #define TYPE_LONGDOUBLE_IS_DOUBLE 0 138 #else 139 #define TYPE_LONGDOUBLE_IS_DOUBLE 1 140 #endif 141 #else 142 #define TYPE_LONGDOUBLE_IS_DOUBLE 0 143 #endif 144 145 #define TYPE_LONGLONG 1 146 #ifdef __cplusplus 147 #define TYPE_BOOL 1 148 #else 149 #define TYPE_BOOL 0 150 #endif 151 152 #define FUNCTION_PASCAL 0 153 #define FUNCTION_DECLSPEC 0 154 #define FUNCTION_WIN32CC 0 155 156 #ifdef __MACOS_CLASSIC__ 157 #ifndef TARGET_API_MAC_CARBON /* gcc cfm cross compiler assumes you're building Carbon code */ 158 #define TARGET_API_MAC_CARBON 1 159 #endif 160 #endif 161 162 163 164#elif defined(__MWERKS__) 165 /* 166 CodeWarrior compiler from Metrowerks/Motorola 167 */ 168 #define PRAGMA_ONCE 1 169 #define PRAGMA_IMPORT 0 170 #define PRAGMA_STRUCT_ALIGN 1 171 #define PRAGMA_STRUCT_PACK 1 172 #define PRAGMA_STRUCT_PACKPUSH 0 173 #define PRAGMA_ENUM_PACK 0 174 #define PRAGMA_ENUM_ALWAYSINT 1 175 #define PRAGMA_ENUM_OPTIONS 0 176 #if __option(enumsalwaysint) && __option(ANSI_strict) 177 #define FOUR_CHAR_CODE(x) ((long)(x)) /* otherwise compiler will complain about values with high bit set */ 178 #else 179 #define FOUR_CHAR_CODE(x) (x) 180 #endif 181 #define FUNCTION_PASCAL 1 182 #define FUNCTION_DECLSPEC 1 183 #define FUNCTION_WIN32CC 0 184 185 #if __option(longlong) 186 #define TYPE_LONGLONG 1 187 #else 188 #define TYPE_LONGLONG 0 189 #endif 190 #if __option(bool) 191 #define TYPE_BOOL 1 192 #else 193 #define TYPE_BOOL 0 194 #endif 195 #define TYPE_EXTENDED 0 196 #define TYPE_LONGDOUBLE_IS_DOUBLE 1 197 198 199 200#else 201 /* 202 Unknown compiler, perhaps set up from the command line 203 */ 204 #error unknown compiler 205 #ifndef PRAGMA_IMPORT 206 #define PRAGMA_IMPORT 0 207 #endif 208 #ifndef PRAGMA_STRUCT_ALIGN 209 #define PRAGMA_STRUCT_ALIGN 0 210 #endif 211 #ifndef PRAGMA_ONCE 212 #define PRAGMA_ONCE 0 213 #endif 214 #ifndef PRAGMA_STRUCT_PACK 215 #define PRAGMA_STRUCT_PACK 0 216 #endif 217 #ifndef PRAGMA_STRUCT_PACKPUSH 218 #define PRAGMA_STRUCT_PACKPUSH 0 219 #endif 220 #ifndef PRAGMA_ENUM_PACK 221 #define PRAGMA_ENUM_PACK 0 222 #endif 223 #ifndef PRAGMA_ENUM_ALWAYSINT 224 #define PRAGMA_ENUM_ALWAYSINT 0 225 #endif 226 #ifndef PRAGMA_ENUM_OPTIONS 227 #define PRAGMA_ENUM_OPTIONS 0 228 #endif 229 #ifndef FOUR_CHAR_CODE 230 #define FOUR_CHAR_CODE(x) (x) 231 #endif 232 233 #ifndef TYPE_LONGDOUBLE_IS_DOUBLE 234 #define TYPE_LONGDOUBLE_IS_DOUBLE 1 235 #endif 236 #ifndef TYPE_EXTENDED 237 #define TYPE_EXTENDED 0 238 #endif 239 #ifndef TYPE_LONGLONG 240 #define TYPE_LONGLONG 0 241 #endif 242 #ifndef TYPE_BOOL 243 #define TYPE_BOOL 0 244 #endif 245 #ifndef FUNCTION_PASCAL 246 #define FUNCTION_PASCAL 0 247 #endif 248 #ifndef FUNCTION_DECLSPEC 249 #define FUNCTION_DECLSPEC 0 250 #endif 251 #ifndef FUNCTION_WIN32CC 252 #define FUNCTION_WIN32CC 0 253 #endif 254#endif 255 256 257 258 259/**************************************************************************************************** 260 261 Under MacOS, the classic 68k runtime has two calling conventions: pascal or C 262 Under Win32, there are two calling conventions: __cdecl or __stdcall 263 Headers and implementation files can use the following macros to make their 264 source more portable by hiding the calling convention details: 265 266 EXTERN_API* 267 These macros are used to specify the calling convention on a function prototype. 268 269 EXTERN_API - Classic 68k: pascal, Win32: __cdecl 270 EXTERN_API_C - Classic 68k: C, Win32: __cdecl 271 EXTERN_API_STDCALL - Classic 68k: pascal, Win32: __stdcall 272 EXTERN_API_C_STDCALL - Classic 68k: C, Win32: __stdcall 273 274 275 DEFINE_API* 276 These macros are used to specify the calling convention on a function definition. 277 278 DEFINE_API - Classic 68k: pascal, Win32: __cdecl 279 DEFINE_API_C - Classic 68k: C, Win32: __cdecl 280 DEFINE_API_STDCALL - Classic 68k: pascal, Win32: __stdcall 281 DEFINE_API_C_STDCALL - Classic 68k: C, Win32: __stdcall 282 283 284 CALLBACK_API* 285 These macros are used to specify the calling convention of a function pointer. 286 287 CALLBACK_API - Classic 68k: pascal, Win32: __stdcall 288 CALLBACK_API_C - Classic 68k: C, Win32: __stdcall 289 CALLBACK_API_STDCALL - Classic 68k: pascal, Win32: __cdecl 290 CALLBACK_API_C_STDCALL - Classic 68k: C, Win32: __cdecl 291 292****************************************************************************************************/ 293 294#if FUNCTION_PASCAL && !FUNCTION_DECLSPEC && !FUNCTION_WIN32CC 295 /* compiler supports pascal keyword only */ 296 #define EXTERN_API(_type) extern pascal _type 297 #define EXTERN_API_C(_type) extern _type 298 #define EXTERN_API_STDCALL(_type) extern pascal _type 299 #define EXTERN_API_C_STDCALL(_type) extern _type 300 301 #define DEFINE_API(_type) pascal _type 302 #define DEFINE_API_C(_type) _type 303 #define DEFINE_API_STDCALL(_type) pascal _type 304 #define DEFINE_API_C_STDCALL(_type) _type 305 306 #define CALLBACK_API(_type, _name) pascal _type (*_name) 307 #define CALLBACK_API_C(_type, _name) _type (*_name) 308 #define CALLBACK_API_STDCALL(_type, _name) pascal _type (*_name) 309 #define CALLBACK_API_C_STDCALL(_type, _name) _type (*_name) 310 311#elif FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC 312 /* compiler supports pascal and __declspec() */ 313 #define EXTERN_API(_type) extern pascal __declspec(dllimport) _type 314 #define EXTERN_API_C(_type) extern __declspec(dllimport) _type 315 #define EXTERN_API_STDCALL(_type) extern pascal __declspec(dllimport) _type 316 #define EXTERN_API_C_STDCALL(_type) extern __declspec(dllimport) _type 317 318 #define DEFINE_API(_type) pascal __declspec(dllexport) _type 319 #define DEFINE_API_C(_type) __declspec(dllexport) _type 320 #define DEFINE_API_STDCALL(_type) pascal __declspec(dllexport) _type 321 #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type 322 323 #define CALLBACK_API(_type, _name) pascal _type (*_name) 324 #define CALLBACK_API_C(_type, _name) _type (*_name) 325 #define CALLBACK_API_STDCALL(_type, _name) pascal _type (*_name) 326 #define CALLBACK_API_C_STDCALL(_type, _name) _type (*_name) 327 328#elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC 329 /* compiler supports __declspec() */ 330 #define EXTERN_API(_type) extern __declspec(dllimport) _type 331 #define EXTERN_API_C(_type) extern __declspec(dllimport) _type 332 #define EXTERN_API_STDCALL(_type) extern __declspec(dllimport) _type 333 #define EXTERN_API_C_STDCALL(_type) extern __declspec(dllimport) _type 334 335 #define DEFINE_API(_type) __declspec(dllexport) _type 336 #define DEFINE_API_C(_type) __declspec(dllexport) _type 337 #define DEFINE_API_STDCALL(_type) __declspec(dllexport) _type 338 #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type 339 340 #define CALLBACK_API(_type, _name) _type ( * _name) 341 #define CALLBACK_API_C(_type, _name) _type ( * _name) 342 #define CALLBACK_API_STDCALL(_type, _name) _type ( * _name) 343 #define CALLBACK_API_C_STDCALL(_type, _name) _type ( * _name) 344 345#elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && FUNCTION_WIN32CC 346 /* compiler supports __declspec() and __cdecl */ 347 #define EXTERN_API(_type) __declspec(dllimport) _type __cdecl 348 #define EXTERN_API_C(_type) __declspec(dllimport) _type __cdecl 349 #define EXTERN_API_STDCALL(_type) __declspec(dllimport) _type __stdcall 350 #define EXTERN_API_C_STDCALL(_type) __declspec(dllimport) _type __stdcall 351 352 #define DEFINE_API(_type) __declspec(dllexport) _type __cdecl 353 #define DEFINE_API_C(_type) __declspec(dllexport) _type __cdecl 354 #define DEFINE_API_STDCALL(_type) __declspec(dllexport) _type __stdcall 355 #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type __stdcall 356 357 #define CALLBACK_API(_type, _name) _type (__cdecl * _name) 358 #define CALLBACK_API_C(_type, _name) _type (__cdecl * _name) 359 #define CALLBACK_API_STDCALL(_type, _name) _type (__stdcall * _name) 360 #define CALLBACK_API_C_STDCALL(_type, _name) _type (__stdcall * _name) 361 362#elif !FUNCTION_PASCAL && !FUNCTION_DECLSPEC && FUNCTION_WIN32CC 363 /* compiler supports __cdecl */ 364 #define EXTERN_API(_type) _type __cdecl 365 #define EXTERN_API_C(_type) _type __cdecl 366 #define EXTERN_API_STDCALL(_type) _type __stdcall 367 #define EXTERN_API_C_STDCALL(_type) _type __stdcall 368 369 #define DEFINE_API(_type) _type __cdecl 370 #define DEFINE_API_C(_type) _type __cdecl 371 #define DEFINE_API_STDCALL(_type) _type __stdcall 372 #define DEFINE_API_C_STDCALL(_type) _type __stdcall 373 374 #define CALLBACK_API(_type, _name) _type (__cdecl * _name) 375 #define CALLBACK_API_C(_type, _name) _type (__cdecl * _name) 376 #define CALLBACK_API_STDCALL(_type, _name) _type (__stdcall * _name) 377 #define CALLBACK_API_C_STDCALL(_type, _name) _type (__stdcall * _name) 378 379#else 380 /* compiler supports no extensions */ 381 #define EXTERN_API(_type) extern _type 382 #define EXTERN_API_C(_type) extern _type 383 #define EXTERN_API_STDCALL(_type) extern _type 384 #define EXTERN_API_C_STDCALL(_type) extern _type 385 386 #define DEFINE_API(_type) _type 387 #define DEFINE_API_C(_type) _type 388 #define DEFINE_API_STDCALL(_type) _type 389 #define DEFINE_API_C_STDCALL(_type) _type 390 391 #define CALLBACK_API(_type, _name) _type ( * _name) 392 #define CALLBACK_API_C(_type, _name) _type ( * _name) 393 #define CALLBACK_API_STDCALL(_type, _name) _type ( * _name) 394 #define CALLBACK_API_C_STDCALL(_type, _name) _type ( * _name) 395 #undef pascal 396 #define pascal 397#endif 398 399/**************************************************************************************************** 400 401 Set up TARGET_API_*_* values 402 403****************************************************************************************************/ 404#if !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON) 405/* No TARGET_API_MAC_* predefined on command line */ 406#if TARGET_RT_MAC_MACHO 407/* Looks like MachO style compiler */ 408#define TARGET_API_MAC_OS8 0 409#define TARGET_API_MAC_CARBON 1 410#define TARGET_API_MAC_OSX 1 411#elif defined(TARGET_CARBON) && TARGET_CARBON 412/* grandfather in use of TARGET_CARBON */ 413#define TARGET_API_MAC_OS8 0 414#define TARGET_API_MAC_CARBON 1 415#define TARGET_API_MAC_OSX 0 416#elif TARGET_CPU_PPC && TARGET_RT_MAC_CFM 417/* Looks like CFM style PPC compiler */ 418#define TARGET_API_MAC_OS8 1 419#define TARGET_API_MAC_CARBON 0 420#define TARGET_API_MAC_OSX 0 421#else 422/* 68k or some other compiler */ 423#define TARGET_API_MAC_OS8 1 424#define TARGET_API_MAC_CARBON 0 425#define TARGET_API_MAC_OSX 0 426#endif /* */ 427 428#else 429#ifndef TARGET_API_MAC_OS8 430#define TARGET_API_MAC_OS8 0 431#endif /* !defined(TARGET_API_MAC_OS8) */ 432 433#ifndef TARGET_API_MAC_OSX 434#define TARGET_API_MAC_OSX TARGET_RT_MAC_MACHO 435#endif /* !defined(TARGET_API_MAC_OSX) */ 436 437#ifndef TARGET_API_MAC_CARBON 438#define TARGET_API_MAC_CARBON TARGET_API_MAC_OSX 439#endif /* !defined(TARGET_API_MAC_CARBON) */ 440 441#endif /* !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON) */ 442 443#if TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX 444#error TARGET_API_MAC_OS8 and TARGET_API_MAC_OSX are mutually exclusive 445#endif /* TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX */ 446 447#if !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX 448#error At least one of TARGET_API_MAC_* must be true 449#endif /* !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX */ 450 451/* Support source code still using TARGET_CARBON */ 452#ifndef TARGET_CARBON 453#if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 454#define TARGET_CARBON 1 455#else 456#define TARGET_CARBON 0 457#endif /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */ 458 459#endif /* !defined(TARGET_CARBON) */ 460 461/**************************************************************************************************** 462 Backward compatibility for clients expecting 2.x version on ConditionalMacros.h 463 464 GENERATINGPOWERPC - Compiler is generating PowerPC instructions 465 GENERATING68K - Compiler is generating 68k family instructions 466 GENERATING68881 - Compiler is generating mc68881 floating point instructions 467 GENERATINGCFM - Code being generated assumes CFM calling conventions 468 CFMSYSTEMCALLS - No A-traps. Systems calls are made using CFM and UPP's 469 PRAGMA_ALIGN_SUPPORTED - Compiler supports: #pragma options align=mac68k/power/reset 470 PRAGMA_IMPORT_SUPPORTED - Compiler supports: #pragma import on/off/reset 471 CGLUESUPPORTED - Clients can use all lowercase toolbox functions that take C strings instead of pascal strings 472 473****************************************************************************************************/ 474#if !TARGET_API_MAC_CARBON 475#define GENERATINGPOWERPC TARGET_CPU_PPC 476#define GENERATING68K 0 477#define GENERATING68881 TARGET_RT_MAC_68881 478#define GENERATINGCFM TARGET_RT_MAC_CFM 479#define CFMSYSTEMCALLS TARGET_RT_MAC_CFM 480#ifndef CGLUESUPPORTED 481#define CGLUESUPPORTED 0 482#endif /* !defined(CGLUESUPPORTED) */ 483 484#ifndef OLDROUTINELOCATIONS 485#define OLDROUTINELOCATIONS 0 486#endif /* !defined(OLDROUTINELOCATIONS) */ 487 488#define PRAGMA_ALIGN_SUPPORTED PRAGMA_STRUCT_ALIGN 489#define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT 490#else 491/* Carbon code should not use old conditionals */ 492#define PRAGMA_ALIGN_SUPPORTED ..PRAGMA_ALIGN_SUPPORTED_is_obsolete.. 493#define GENERATINGPOWERPC ..GENERATINGPOWERPC_is_obsolete.. 494#define GENERATING68K ..GENERATING68K_is_obsolete.. 495#define GENERATING68881 ..GENERATING68881_is_obsolete.. 496#define GENERATINGCFM ..GENERATINGCFM_is_obsolete.. 497#define CFMSYSTEMCALLS ..CFMSYSTEMCALLS_is_obsolete.. 498#endif /* !TARGET_API_MAC_CARBON */ 499 500 501 502/**************************************************************************************************** 503 504 OLDROUTINENAMES - "Old" names for Macintosh system calls are allowed in source code. 505 (e.g. DisposPtr instead of DisposePtr). The names of system routine 506 are now more sensitive to change because CFM binds by name. In the 507 past, system routine names were compiled out to just an A-Trap. 508 Macros have been added that each map an old name to its new name. 509 This allows old routine names to be used in existing source files, 510 but the macros only work if OLDROUTINENAMES is true. This support 511 will be removed in the near future. Thus, all source code should 512 be changed to use the new names! You can set OLDROUTINENAMES to false 513 to see if your code has any old names left in it. 514 515****************************************************************************************************/ 516#ifndef OLDROUTINENAMES 517#define OLDROUTINENAMES 0 518#endif /* !defined(OLDROUTINENAMES) */ 519 520 521 522/**************************************************************************************************** 523 The following macros isolate the use of 68K inlines in function prototypes. 524 On the Mac OS under the Classic 68K runtime, function prototypes were followed 525 by a list of 68K opcodes which the compiler inserted in the generated code instead 526 of a JSR. Under Classic 68K on the Mac OS, this macro will put the opcodes 527 in the right syntax. For all other OS's and runtimes the macro suppress the opcodes. 528 Example: 529 530 EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect) 531 ONEWORDINLINE(0xA8F6); 532 533****************************************************************************************************/ 534 535#if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM 536 #define ONEWORDINLINE(w1) = w1 537 #define TWOWORDINLINE(w1,w2) = {w1,w2} 538 #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3} 539 #define FOURWORDINLINE(w1,w2,w3,w4) = {w1,w2,w3,w4} 540 #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5} 541 #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6) = {w1,w2,w3,w4,w5,w6} 542 #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7) = {w1,w2,w3,w4,w5,w6,w7} 543 #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8) = {w1,w2,w3,w4,w5,w6,w7,w8} 544 #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9) = {w1,w2,w3,w4,w5,w6,w7,w8,w9} 545 #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10} 546 #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11} 547 #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12} 548#else 549 #define ONEWORDINLINE(w1) 550 #define TWOWORDINLINE(w1,w2) 551 #define THREEWORDINLINE(w1,w2,w3) 552 #define FOURWORDINLINE(w1,w2,w3,w4) 553 #define FIVEWORDINLINE(w1,w2,w3,w4,w5) 554 #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6) 555 #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7) 556 #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8) 557 #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9) 558 #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10) 559 #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11) 560 #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12) 561#endif 562 563 564/**************************************************************************************************** 565 566 TARGET_CARBON - default: false. Switches all of the above as described. Overrides all others 567 - NOTE: If you set TARGET_CARBON to 1, then the other switches will be setup by 568 ConditionalMacros, and should not be set manually. 569 570 If you wish to do development for pre-Carbon Systems, you can set the following: 571 572 OPAQUE_TOOLBOX_STRUCTS - default: false. True for Carbon builds, hides struct fields. 573 OPAQUE_UPP_TYPES - default: false. True for Carbon builds, UPP types are unique and opaque. 574 ACCESSOR_CALLS_ARE_FUNCTIONS - default: false. True for Carbon builds, enables accessor functions. 575 CALL_NOT_IN_CARBON - default: true. False for Carbon builds, hides calls not supported in Carbon. 576 577 Specifically, if you are building a non-Carbon application (one that links against InterfaceLib) 578 but you wish to use some of the accessor functions, you can set ACCESSOR_CALLS_ARE_FUNCTIONS to 1 579 and link with CarbonAccessors.o, which implements just the accessor functions. This will help you 580 preserve source compatibility between your Carbon and non-Carbon application targets. 581 582 MIXEDMODE_CALLS_ARE_FUNCTIONS - deprecated. 583 584****************************************************************************************************/ 585#if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 586#ifndef OPAQUE_TOOLBOX_STRUCTS 587#define OPAQUE_TOOLBOX_STRUCTS 1 588#endif /* !defined(OPAQUE_TOOLBOX_STRUCTS) */ 589 590#ifndef OPAQUE_UPP_TYPES 591#define OPAQUE_UPP_TYPES 1 592#endif /* !defined(OPAQUE_UPP_TYPES) */ 593 594#ifndef ACCESSOR_CALLS_ARE_FUNCTIONS 595#define ACCESSOR_CALLS_ARE_FUNCTIONS 1 596#endif /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */ 597 598#ifndef CALL_NOT_IN_CARBON 599#define CALL_NOT_IN_CARBON 0 600#endif /* !defined(CALL_NOT_IN_CARBON) */ 601 602#ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS 603#define MIXEDMODE_CALLS_ARE_FUNCTIONS 1 604#endif /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */ 605 606#else 607#ifndef OPAQUE_TOOLBOX_STRUCTS 608#define OPAQUE_TOOLBOX_STRUCTS 0 609#endif /* !defined(OPAQUE_TOOLBOX_STRUCTS) */ 610 611#ifndef ACCESSOR_CALLS_ARE_FUNCTIONS 612#define ACCESSOR_CALLS_ARE_FUNCTIONS 0 613#endif /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */ 614 615/* 616 * It's possible to have ACCESSOR_CALLS_ARE_FUNCTIONS set to true and OPAQUE_TOOLBOX_STRUCTS 617 * set to false, but not the other way around, so make sure the defines are not set this way. 618 */ 619#ifndef CALL_NOT_IN_CARBON 620#define CALL_NOT_IN_CARBON 1 621#endif /* !defined(CALL_NOT_IN_CARBON) */ 622 623#ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS 624#define MIXEDMODE_CALLS_ARE_FUNCTIONS 0 625#endif /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */ 626 627#endif /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */ 628 629 630 631 632#endif /* __CONDITIONALMACROS__ */ 633