4
Contains: Fixed Math Interfaces.
6
Version: Technology: Mac OS 8
7
Release: Universal Interfaces 3.4.2
9
Copyright: � 1985-2002 by Apple Computer, Inc., all rights reserved
11
Bugs?: For bug reports, consult the following page on
14
http://www.freepascal.org/bugs.html
20
Modified for use with Free Pascal
22
Please report any bugs to <gpc@microbizz.nl>
33
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
34
{$setc GAP_INTERFACES_VERSION := $0200}
36
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
37
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
40
{$ifc defined CPUPOWERPC and defined CPUI386}
41
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
43
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
44
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
47
{$ifc not defined __ppc__ and defined CPUPOWERPC}
52
{$ifc not defined __i386__ and defined CPUI386}
58
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
59
{$error Conflicting definitions for __ppc__ and __i386__}
62
{$ifc defined __ppc__ and __ppc__}
63
{$setc TARGET_CPU_PPC := TRUE}
64
{$setc TARGET_CPU_X86 := FALSE}
65
{$elifc defined __i386__ and __i386__}
66
{$setc TARGET_CPU_PPC := FALSE}
67
{$setc TARGET_CPU_X86 := TRUE}
69
{$error Neither __ppc__ nor __i386__ is defined.}
71
{$setc TARGET_CPU_PPC_64 := FALSE}
73
{$ifc defined FPC_BIG_ENDIAN}
74
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
75
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
76
{$elifc defined FPC_LITTLE_ENDIAN}
77
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
78
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
80
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
82
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
83
{$setc CALL_NOT_IN_CARBON := FALSE}
84
{$setc OLDROUTINENAMES := FALSE}
85
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
86
{$setc OPAQUE_UPP_TYPES := TRUE}
87
{$setc OTCARBONAPPLICATION := TRUE}
88
{$setc OTKERNEL := FALSE}
89
{$setc PM_USE_SESSION_APIS := TRUE}
90
{$setc TARGET_API_MAC_CARBON := TRUE}
91
{$setc TARGET_API_MAC_OS8 := FALSE}
92
{$setc TARGET_API_MAC_OSX := TRUE}
93
{$setc TARGET_CARBON := TRUE}
94
{$setc TARGET_CPU_68K := FALSE}
95
{$setc TARGET_CPU_MIPS := FALSE}
96
{$setc TARGET_CPU_SPARC := FALSE}
97
{$setc TARGET_OS_MAC := TRUE}
98
{$setc TARGET_OS_UNIX := FALSE}
99
{$setc TARGET_OS_WIN32 := FALSE}
100
{$setc TARGET_RT_MAC_68881 := FALSE}
101
{$setc TARGET_RT_MAC_CFM := FALSE}
102
{$setc TARGET_RT_MAC_MACHO := TRUE}
103
{$setc TYPED_FUNCTION_POINTERS := TRUE}
104
{$setc TYPE_BOOL := FALSE}
105
{$setc TYPE_EXTENDED := FALSE}
106
{$setc TYPE_LONGLONG := TRUE}
116
positiveInfinity = $7FFFFFFF;
117
negativeInfinity = $80000000;
120
FixRatio, FixMul, and FixRound were previously in ToolUtils.h
126
* Non-Carbon CFM: in InterfaceLib 7.1 and later
127
* CarbonLib: in CarbonLib 1.0 and later
128
* Mac OS X: in version 10.0 and later
130
function FixRatio(numer: SInt16; denom: SInt16): Fixed; external name '_FixRatio';
135
* Non-Carbon CFM: in InterfaceLib 7.1 and later
136
* CarbonLib: in CarbonLib 1.0 and later
137
* Mac OS X: in version 10.0 and later
139
function FixMul(a: Fixed; b: Fixed): Fixed; external name '_FixMul';
144
* Non-Carbon CFM: in InterfaceLib 7.1 and later
145
* CarbonLib: in CarbonLib 1.0 and later
146
* Mac OS X: in version 10.0 and later
148
function FixRound(x: Fixed): SInt16; external name '_FixRound';
153
* Non-Carbon CFM: in InterfaceLib 7.1 and later
154
* CarbonLib: in CarbonLib 1.0 and later
155
* Mac OS X: in version 10.0 and later
157
function Fix2Frac(x: Fixed): Fract; external name '_Fix2Frac';
162
* Non-Carbon CFM: in InterfaceLib 7.1 and later
163
* CarbonLib: in CarbonLib 1.0 and later
164
* Mac OS X: in version 10.0 and later
166
function Fix2Long(x: Fixed): SInt32; external name '_Fix2Long';
171
* Non-Carbon CFM: in InterfaceLib 7.1 and later
172
* CarbonLib: in CarbonLib 1.0 and later
173
* Mac OS X: in version 10.0 and later
175
function Long2Fix(x: SInt32): Fixed; external name '_Long2Fix';
180
* Non-Carbon CFM: in InterfaceLib 7.1 and later
181
* CarbonLib: in CarbonLib 1.0 and later
182
* Mac OS X: in version 10.0 and later
184
function Frac2Fix(x: Fract): Fixed; external name '_Frac2Fix';
189
* Non-Carbon CFM: in InterfaceLib 7.1 and later
190
* CarbonLib: in CarbonLib 1.0 and later
191
* Mac OS X: in version 10.0 and later
193
function FracMul(x: Fract; y: Fract): Fract; external name '_FracMul';
198
* Non-Carbon CFM: in InterfaceLib 7.1 and later
199
* CarbonLib: in CarbonLib 1.0 and later
200
* Mac OS X: in version 10.0 and later
202
function FixDiv(x: Fixed; y: Fixed): Fixed; external name '_FixDiv';
207
* Non-Carbon CFM: in InterfaceLib 7.1 and later
208
* CarbonLib: in CarbonLib 1.0 and later
209
* Mac OS X: in version 10.0 and later
211
function FracDiv(x: Fract; y: Fract): Fract; external name '_FracDiv';
216
* Non-Carbon CFM: in InterfaceLib 7.1 and later
217
* CarbonLib: in CarbonLib 1.0 and later
218
* Mac OS X: in version 10.0 and later
220
function FracSqrt(x: Fract): Fract; external name '_FracSqrt';
225
* Non-Carbon CFM: in InterfaceLib 7.1 and later
226
* CarbonLib: in CarbonLib 1.0 and later
227
* Mac OS X: in version 10.0 and later
229
function FracSin(x: Fixed): Fract; external name '_FracSin';
234
* Non-Carbon CFM: in InterfaceLib 7.1 and later
235
* CarbonLib: in CarbonLib 1.0 and later
236
* Mac OS X: in version 10.0 and later
238
function FracCos(x: Fixed): Fract; external name '_FracCos';
243
* Non-Carbon CFM: in InterfaceLib 7.1 and later
244
* CarbonLib: in CarbonLib 1.0 and later
245
* Mac OS X: in version 10.0 and later
247
function FixATan2(x: SInt32; y: SInt32): Fixed; external name '_FixATan2';
249
Frac2X, Fix2X, X2Fix, and X2Frac translate to and from
250
the floating point type "extended" (that's what the X is for).
251
On the original Mac this was 80-bits and the functions could be
252
accessed via A-Traps. When the 68881 co-processor was added,
253
it used 96-bit floating point types, so the A-Traps could not
254
be used. When PowerPC was added, it used 64-bit floating point
255
types, so yet another prototype was added.
257
{$ifc TARGET_CPU_68K}
258
{$ifc TARGET_RT_MAC_68881}
259
{$ifc CALL_NOT_IN_CARBON}
264
* Non-Carbon CFM: not available
265
* CarbonLib: not available
266
* Mac OS X: not available
268
function Frac2X(x: Fract): extended; external name '_Frac2X';
274
* Non-Carbon CFM: not available
275
* CarbonLib: not available
276
* Mac OS X: not available
278
function Fix2X(x: Fixed): extended; external name '_Fix2X';
284
* Non-Carbon CFM: not available
285
* CarbonLib: not available
286
* Mac OS X: not available
288
function X2Fix(x: extended): Fixed; external name '_X2Fix';
294
* Non-Carbon CFM: not available
295
* CarbonLib: not available
296
* Mac OS X: not available
298
function X2Frac(x: extended): Fract; external name '_X2Frac';
300
{$endc} {CALL_NOT_IN_CARBON}
302
{$ifc CALL_NOT_IN_CARBON}
307
* Non-Carbon CFM: not available
308
* CarbonLib: not available
309
* Mac OS X: not available
311
function Frac2X(x: Fract): extended; external name '_Frac2X';
316
* Non-Carbon CFM: not available
317
* CarbonLib: not available
318
* Mac OS X: not available
320
function Fix2X(x: Fixed): extended; external name '_Fix2X';
325
* Non-Carbon CFM: not available
326
* CarbonLib: not available
327
* Mac OS X: not available
329
function X2Fix(x: extended): Fixed; external name '_X2Fix';
334
* Non-Carbon CFM: not available
335
* CarbonLib: not available
336
* Mac OS X: not available
338
function X2Frac(x: extended): Fract; external name '_X2Frac';
339
{$endc} {CALL_NOT_IN_CARBON}
340
{$endc} {TARGET_RT_MAC_68881}
346
* Non-Carbon CFM: in InterfaceLib 7.1 and later
347
* CarbonLib: in CarbonLib 1.0 and later
348
* Mac OS X: in version 10.0 and later
350
function Frac2X(x: Fract): Double; external name '_Frac2X';
356
* Non-Carbon CFM: in InterfaceLib 7.1 and later
357
* CarbonLib: in CarbonLib 1.0 and later
358
* Mac OS X: in version 10.0 and later
360
function Fix2X(x: Fixed): Double; external name '_Fix2X';
366
* Non-Carbon CFM: in InterfaceLib 7.1 and later
367
* CarbonLib: in CarbonLib 1.0 and later
368
* Mac OS X: in version 10.0 and later
370
function X2Fix(x: Double): Fixed; external name '_X2Fix';
376
* Non-Carbon CFM: in InterfaceLib 7.1 and later
377
* CarbonLib: in CarbonLib 1.0 and later
378
* Mac OS X: in version 10.0 and later
380
function X2Frac(x: Double): Fract; external name '_X2Frac';
382
{$endc} {TARGET_CPU_68K}
384
{ QuickTime 3.0 makes these Wide routines available on other platforms }
385
{$ifc TARGET_CPU_PPC OR NOT TARGET_OS_MAC}
390
* Non-Carbon CFM: in InterfaceLib 7.1 and later
391
* CarbonLib: in CarbonLib 1.0 and later
392
* Mac OS X: in version 10.0 and later
394
function WideCompare(const (*var*) target: wide; const (*var*) source: wide): SInt16; external name '_WideCompare';
400
* Non-Carbon CFM: in InterfaceLib 7.1 and later
401
* CarbonLib: in CarbonLib 1.0 and later
402
* Mac OS X: in version 10.0 and later
404
function WideAdd(var target: wide; const (*var*) source: wide): widePtr; external name '_WideAdd';
410
* Non-Carbon CFM: in InterfaceLib 7.1 and later
411
* CarbonLib: in CarbonLib 1.0 and later
412
* Mac OS X: in version 10.0 and later
414
function WideSubtract(var target: wide; const (*var*) source: wide): widePtr; external name '_WideSubtract';
420
* Non-Carbon CFM: in InterfaceLib 7.1 and later
421
* CarbonLib: in CarbonLib 1.0 and later
422
* Mac OS X: in version 10.0 and later
424
function WideNegate(var target: wide): widePtr; external name '_WideNegate';
430
* Non-Carbon CFM: in InterfaceLib 7.1 and later
431
* CarbonLib: in CarbonLib 1.0 and later
432
* Mac OS X: in version 10.0 and later
434
function WideShift(var target: wide; shift: SInt32): widePtr; external name '_WideShift';
440
* Non-Carbon CFM: in InterfaceLib 7.1 and later
441
* CarbonLib: in CarbonLib 1.0 and later
442
* Mac OS X: in version 10.0 and later
444
function WideSquareRoot(const (*var*) source: wide): UInt32; external name '_WideSquareRoot';
450
* Non-Carbon CFM: in InterfaceLib 7.1 and later
451
* CarbonLib: in CarbonLib 1.0 and later
452
* Mac OS X: in version 10.0 and later
454
function WideMultiply(multiplicand: SInt32; multiplier: SInt32; var target: wide): widePtr; external name '_WideMultiply';
456
{ returns the quotient }
461
* Non-Carbon CFM: in InterfaceLib 7.1 and later
462
* CarbonLib: in CarbonLib 1.0 and later
463
* Mac OS X: in version 10.0 and later
465
function WideDivide(const (*var*) dividend: wide; divisor: SInt32; var remainder: SInt32): SInt32; external name '_WideDivide';
467
{ quotient replaces dividend }
472
* Non-Carbon CFM: in InterfaceLib 7.1 and later
473
* CarbonLib: in CarbonLib 1.0 and later
474
* Mac OS X: in version 10.0 and later
476
function WideWideDivide(var dividend: wide; divisor: SInt32; var remainder: SInt32): widePtr; external name '_WideWideDivide';
482
* Non-Carbon CFM: in InterfaceLib 7.1 and later
483
* CarbonLib: in CarbonLib 1.0 and later
484
* Mac OS X: in version 10.0 and later
486
function WideBitShift(var src: wide; shift: SInt32): widePtr; external name '_WideBitShift';