1 { CFByteOrder.h
2 Copyright (c) 1995-2009, Apple Inc. All rights reserved.
3 }
4 { Pascal Translation: Peter N Lewis, <peter@stairways.com.au>, August 2005 }
5 { Pascal Translation Updated: Peter N Lewis, <peter@stairways.com.au>, September 2005 }
6 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, April 2006, February 2008, October 2009 }
7 {
8 Modified for use with Free Pascal
9 Version 308
10 Please report any bugs to <gpc@microbizz.nl>
11 }
12
13 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
14 {$mode macpas}
15 {$modeswitch cblocks}
16 {$packenum 1}
17 {$macro on}
18 {$inline on}
19 {$calling mwpascal}
20
21 unit CFByteOrders;
22 interface
23 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
24 {$setc GAP_INTERFACES_VERSION := $0308}
25
26 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
27 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
28 {$endc}
29
30 {$ifc defined CPUPOWERPC and defined CPUI386}
31 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
32 {$endc}
33 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
34 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
35 {$endc}
36
37 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
38 {$setc __ppc__ := 1}
39 {$elsec}
40 {$setc __ppc__ := 0}
41 {$endc}
42 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
43 {$setc __ppc64__ := 1}
44 {$elsec}
45 {$setc __ppc64__ := 0}
46 {$endc}
47 {$ifc not defined __i386__ and defined CPUI386}
48 {$setc __i386__ := 1}
49 {$elsec}
50 {$setc __i386__ := 0}
51 {$endc}
52 {$ifc not defined __x86_64__ and defined CPUX86_64}
53 {$setc __x86_64__ := 1}
54 {$elsec}
55 {$setc __x86_64__ := 0}
56 {$endc}
57 {$ifc not defined __arm__ and defined CPUARM}
58 {$setc __arm__ := 1}
59 {$elsec}
60 {$setc __arm__ := 0}
61 {$endc}
62 {$ifc not defined __arm64__ and defined CPUAARCH64}
63 {$setc __arm64__ := 1}
64 {$elsec}
65 {$setc __arm64__ := 0}
66 {$endc}
67
68 {$ifc defined cpu64}
69 {$setc __LP64__ := 1}
70 {$elsec}
71 {$setc __LP64__ := 0}
72 {$endc}
73
74
75 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
76 {$error Conflicting definitions for __ppc__ and __i386__}
77 {$endc}
78
79 {$ifc defined __ppc__ and __ppc__}
80 {$setc TARGET_CPU_PPC := TRUE}
81 {$setc TARGET_CPU_PPC64 := FALSE}
82 {$setc TARGET_CPU_X86 := FALSE}
83 {$setc TARGET_CPU_X86_64 := FALSE}
84 {$setc TARGET_CPU_ARM := FALSE}
85 {$setc TARGET_CPU_ARM64 := FALSE}
86 {$setc TARGET_OS_MAC := TRUE}
87 {$setc TARGET_OS_IPHONE := FALSE}
88 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
89 {$setc TARGET_OS_EMBEDDED := FALSE}
90 {$elifc defined __ppc64__ and __ppc64__}
91 {$setc TARGET_CPU_PPC := FALSE}
92 {$setc TARGET_CPU_PPC64 := TRUE}
93 {$setc TARGET_CPU_X86 := FALSE}
94 {$setc TARGET_CPU_X86_64 := FALSE}
95 {$setc TARGET_CPU_ARM := FALSE}
96 {$setc TARGET_CPU_ARM64 := FALSE}
97 {$setc TARGET_OS_MAC := TRUE}
98 {$setc TARGET_OS_IPHONE := FALSE}
99 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
100 {$setc TARGET_OS_EMBEDDED := FALSE}
101 {$elifc defined __i386__ and __i386__}
102 {$setc TARGET_CPU_PPC := FALSE}
103 {$setc TARGET_CPU_PPC64 := FALSE}
104 {$setc TARGET_CPU_X86 := TRUE}
105 {$setc TARGET_CPU_X86_64 := FALSE}
106 {$setc TARGET_CPU_ARM := FALSE}
107 {$setc TARGET_CPU_ARM64 := FALSE}
108 {$ifc defined iphonesim}
109 {$setc TARGET_OS_MAC := FALSE}
110 {$setc TARGET_OS_IPHONE := TRUE}
111 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
112 {$elsec}
113 {$setc TARGET_OS_MAC := TRUE}
114 {$setc TARGET_OS_IPHONE := FALSE}
115 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
116 {$endc}
117 {$setc TARGET_OS_EMBEDDED := FALSE}
118 {$elifc defined __x86_64__ and __x86_64__}
119 {$setc TARGET_CPU_PPC := FALSE}
120 {$setc TARGET_CPU_PPC64 := FALSE}
121 {$setc TARGET_CPU_X86 := FALSE}
122 {$setc TARGET_CPU_X86_64 := TRUE}
123 {$setc TARGET_CPU_ARM := FALSE}
124 {$setc TARGET_CPU_ARM64 := FALSE}
125 {$ifc defined iphonesim}
126 {$setc TARGET_OS_MAC := FALSE}
127 {$setc TARGET_OS_IPHONE := TRUE}
128 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
129 {$elsec}
130 {$setc TARGET_OS_MAC := TRUE}
131 {$setc TARGET_OS_IPHONE := FALSE}
132 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
133 {$endc}
134 {$setc TARGET_OS_EMBEDDED := FALSE}
135 {$elifc defined __arm__ and __arm__}
136 {$setc TARGET_CPU_PPC := FALSE}
137 {$setc TARGET_CPU_PPC64 := FALSE}
138 {$setc TARGET_CPU_X86 := FALSE}
139 {$setc TARGET_CPU_X86_64 := FALSE}
140 {$setc TARGET_CPU_ARM := TRUE}
141 {$setc TARGET_CPU_ARM64 := FALSE}
142 {$setc TARGET_OS_MAC := FALSE}
143 {$setc TARGET_OS_IPHONE := TRUE}
144 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
145 {$setc TARGET_OS_EMBEDDED := TRUE}
146 {$elifc defined __arm64__ and __arm64__}
147 {$setc TARGET_CPU_PPC := FALSE}
148 {$setc TARGET_CPU_PPC64 := FALSE}
149 {$setc TARGET_CPU_X86 := FALSE}
150 {$setc TARGET_CPU_X86_64 := FALSE}
151 {$setc TARGET_CPU_ARM := FALSE}
152 {$setc TARGET_CPU_ARM64 := TRUE}
153 {$ifc defined ios}
154 {$setc TARGET_OS_MAC := FALSE}
155 {$setc TARGET_OS_IPHONE := TRUE}
156 {$setc TARGET_OS_EMBEDDED := TRUE}
157 {$elsec}
158 {$setc TARGET_OS_MAC := TRUE}
159 {$setc TARGET_OS_IPHONE := FALSE}
160 {$setc TARGET_OS_EMBEDDED := FALSE}
161 {$endc}
162 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
163 {$elsec}
164 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
165 {$endc}
166
167 {$ifc defined __LP64__ and __LP64__ }
168 {$setc TARGET_CPU_64 := TRUE}
169 {$elsec}
170 {$setc TARGET_CPU_64 := FALSE}
171 {$endc}
172
173 {$ifc defined FPC_BIG_ENDIAN}
174 {$setc TARGET_RT_BIG_ENDIAN := TRUE}
175 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
176 {$elifc defined FPC_LITTLE_ENDIAN}
177 {$setc TARGET_RT_BIG_ENDIAN := FALSE}
178 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
179 {$elsec}
180 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
181 {$endc}
182 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
183 {$setc CALL_NOT_IN_CARBON := FALSE}
184 {$setc OLDROUTINENAMES := FALSE}
185 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
186 {$setc OPAQUE_UPP_TYPES := TRUE}
187 {$setc OTCARBONAPPLICATION := TRUE}
188 {$setc OTKERNEL := FALSE}
189 {$setc PM_USE_SESSION_APIS := TRUE}
190 {$setc TARGET_API_MAC_CARBON := TRUE}
191 {$setc TARGET_API_MAC_OS8 := FALSE}
192 {$setc TARGET_API_MAC_OSX := TRUE}
193 {$setc TARGET_CARBON := TRUE}
194 {$setc TARGET_CPU_68K := FALSE}
195 {$setc TARGET_CPU_MIPS := FALSE}
196 {$setc TARGET_CPU_SPARC := FALSE}
197 {$setc TARGET_OS_UNIX := FALSE}
198 {$setc TARGET_OS_WIN32 := FALSE}
199 {$setc TARGET_RT_MAC_68881 := FALSE}
200 {$setc TARGET_RT_MAC_CFM := FALSE}
201 {$setc TARGET_RT_MAC_MACHO := TRUE}
202 {$setc TYPED_FUNCTION_POINTERS := TRUE}
203 {$setc TYPE_BOOL := FALSE}
204 {$setc TYPE_EXTENDED := FALSE}
205 {$setc TYPE_LONGLONG := TRUE}
206 uses MacTypes,CFBase;
207 {$endc} {not MACOSALLINCLUDE}
208
209 {$ALIGN POWER}
210
211
212 type
213 CFByteOrder = SIGNEDLONG;
214 const
215 CFByteOrderUnknown = 0;
216 CFByteOrderLittleEndian = 1;
217 CFByteOrderBigEndian = 2;
218
CFByteOrderGetCurrentnull219 function CFByteOrderGetCurrent: CFByteOrder; inline;
CFSwapInt16null220 function CFSwapInt16( arg: UInt16 ): UInt16; inline;
CFSwapInt32null221 function CFSwapInt32( arg: UInt32 ): UInt32; inline;
CFSwapInt64null222 function CFSwapInt64( arg: UInt64 ): UInt64; inline;
223
CFSwapInt16BigToHostnull224 function CFSwapInt16BigToHost( arg: UInt16 ): UInt16; inline;
CFSwapInt32BigToHostnull225 function CFSwapInt32BigToHost( arg: UInt32 ): UInt32; inline;
CFSwapInt64BigToHostnull226 function CFSwapInt64BigToHost( arg: UInt64 ): UInt64; inline;
CFSwapInt16HostToBignull227 function CFSwapInt16HostToBig( arg: UInt16 ): UInt16; inline;
CFSwapInt32HostToBignull228 function CFSwapInt32HostToBig( arg: UInt32 ): UInt32; inline;
CFSwapInt64HostToBignull229 function CFSwapInt64HostToBig( arg: UInt64 ): UInt64; inline;
230
231 {$ifc TARGET_RT_BIG_ENDIAN}
232
233
234 {$elsec}
235
236
237
238 {$endc}
239
CFSwapInt16LittleToHostnull240 function CFSwapInt16LittleToHost( arg: UInt16 ): UInt16; inline;
CFSwapInt32LittleToHostnull241 function CFSwapInt32LittleToHost( arg: UInt32 ): UInt32; inline;
CFSwapInt64LittleToHostnull242 function CFSwapInt64LittleToHost( arg: UInt64 ): UInt64; inline;
CFSwapInt16HostToLittlenull243 function CFSwapInt16HostToLittle( arg: UInt16 ): UInt16; inline;
CFSwapInt32HostToLittlenull244 function CFSwapInt32HostToLittle( arg: UInt32 ): UInt32; inline;
CFSwapInt64HostToLittlenull245 function CFSwapInt64HostToLittle( arg: UInt64 ): UInt64; inline;
246
247 {$ifc TARGET_RT_LITTLE_ENDIAN}
248
249
250 {$elsec}
251
252
253
254 {$endc}
255
256 type
257 CFSwappedFloat32 = record
258 v: UInt32;
259 end;
260 type
261 CFSwappedFloat64 = record
262 v: UInt64;
263 end;
264
CFConvertFloat32HostToSwappednull265 function CFConvertFloat32HostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
CFConvertFloat32SwappedToHostnull266 function CFConvertFloat32SwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
CFConvertFloat64HostToSwappednull267 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
CFConvertFloat64SwappedToHostnull268 function CFConvertFloat64SwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
CFConvertFloatHostToSwappednull269 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
CFConvertFloatSwappedToHostnull270 function CFConvertFloatSwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
CFConvertDoubleHostToSwappednull271 function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
CFConvertDoubleSwappedToHostnull272 function CFConvertDoubleSwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
273
274 {$ifc TARGET_RT_LITTLE_ENDIAN}
275
276
277
278 {$elsec}
279
280
281 {$endc}
282
283 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
284 implementation
285
286
287 {$R-}
288
CFByteOrderGetCurrentnull289 function CFByteOrderGetCurrent: CFByteOrder; inline;
290 var
291 x: UInt32 = (CFByteOrderBigEndian shl 24) or CFByteOrderLittleEndian;
292 begin
293 CFByteOrderGetCurrent := CFByteOrder(UInt8Ptr(@x)^);
294 end;
295
CFSwapInt16null296 function CFSwapInt16( arg: UInt16 ): UInt16; inline;
297 begin
298 CFSwapInt16 := (( arg shl 8) and $0FF00) or (( arg shr 8) and $00FF);
299 end;
300
CFSwapInt32null301 function CFSwapInt32( arg: UInt32 ): UInt32; inline;
302 begin
303 CFSwapInt32 := ((arg and $FF) shl 24) or ((arg and $0FF00) shl 8) or ((arg shr 8) and $0FF00) or ((arg shr 24) and $FF);
304 end;
305
CFSwapInt64null306 function CFSwapInt64( arg: UInt64 ): UInt64; inline;
307 begin
308 CFSwapInt64 := (UInt64(CFSwapInt32( arg and $FFFFFFFF )) shl 32) or CFSwapInt32( (arg shr 32) and $FFFFFFFF );
309 end;
310
311 {$ifc TARGET_RT_BIG_ENDIAN}
CFSwapInt16BigToHostnull312 function CFSwapInt16BigToHost( arg: UInt16 ): UInt16; inline;
313 begin
314 CFSwapInt16BigToHost := arg;
315 end;
316
CFSwapInt32BigToHostnull317 function CFSwapInt32BigToHost( arg: UInt32 ): UInt32; inline;
318 begin
319 CFSwapInt32BigToHost := arg;
320 end;
321
CFSwapInt64BigToHostnull322 function CFSwapInt64BigToHost( arg: UInt64 ): UInt64; inline;
323 begin
324 CFSwapInt64BigToHost := arg;
325 end;
326
CFSwapInt16HostToBignull327 function CFSwapInt16HostToBig( arg: UInt16 ): UInt16; inline;
328 begin
329 CFSwapInt16HostToBig := arg;
330 end;
331
CFSwapInt32HostToBignull332 function CFSwapInt32HostToBig( arg: UInt32 ): UInt32; inline;
333 begin
334 CFSwapInt32HostToBig := arg;
335 end;
336
CFSwapInt64HostToBignull337 function CFSwapInt64HostToBig( arg: UInt64 ): UInt64; inline;
338 begin
339 CFSwapInt64HostToBig := arg;
340 end;
341
CFSwapInt16LittleToHostnull342 function CFSwapInt16LittleToHost( arg: UInt16 ): UInt16; inline;
343 begin
344 CFSwapInt16LittleToHost := CFSwapInt16(arg);
345 end;
346
CFSwapInt32LittleToHostnull347 function CFSwapInt32LittleToHost( arg: UInt32 ): UInt32; inline;
348 begin
349 CFSwapInt32LittleToHost := CFSwapInt32(arg);
350 end;
351
CFSwapInt64LittleToHostnull352 function CFSwapInt64LittleToHost( arg: UInt64 ): UInt64; inline;
353 begin
354 CFSwapInt64LittleToHost := CFSwapInt64(arg);
355 end;
356
CFSwapInt16HostToLittlenull357 function CFSwapInt16HostToLittle( arg: UInt16 ): UInt16; inline;
358 begin
359 CFSwapInt16HostToLittle := CFSwapInt16(arg);
360 end;
361
CFSwapInt32HostToLittlenull362 function CFSwapInt32HostToLittle( arg: UInt32 ): UInt32; inline;
363 begin
364 CFSwapInt32HostToLittle := CFSwapInt32(arg);
365 end;
366
CFSwapInt64HostToLittlenull367 function CFSwapInt64HostToLittle( arg: UInt64 ): UInt64; inline;
368 begin
369 CFSwapInt64HostToLittle := CFSwapInt64(arg);
370 end;
371
CFConvertFloat32HostToSwappednull372 function CFConvertFloat32HostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
373 begin
374 CFConvertFloat32HostToSwapped := CFSwappedFloat32(arg);
375 end;
376
CFConvertFloat32SwappedToHostnull377 function CFConvertFloat32SwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
378 begin
379 CFConvertFloat32SwappedToHost := Float32(arg);
380 end;
381
CFConvertFloat64HostToSwappednull382 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
383 begin
384 CFConvertFloat64HostToSwapped := CFSwappedFloat64(arg);
385 end;
386
CFConvertFloat64SwappedToHostnull387 function CFConvertFloat64SwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
388 begin
389 CFConvertFloat64SwappedToHost := Float64(arg);
390 end;
391
CFConvertFloatHostToSwappednull392 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
393 begin
394 CFConvertFloatHostToSwapped := CFSwappedFloat32(arg);
395 end;
396
CFConvertFloatSwappedToHostnull397 function CFConvertFloatSwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
398 begin
399 CFConvertFloatSwappedToHost := Float32(arg);
400 end;
401
CFConvertDoubleHostToSwappednull402 function CFConvertDoubleHostToSwapped( arg: Float64): CFSwappedFloat64; inline;
403 begin
404 CFConvertDoubleHostToSwapped := CFSwappedFloat64(arg);
405 end;
406
CFConvertDoubleSwappedToHostnull407 function CFConvertDoubleSwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
408 begin
409 CFConvertDoubleSwappedToHost := Float64(arg);
410 end;
411
412 {$elsec}
413
CFSwapInt16LittleToHostnull414 function CFSwapInt16LittleToHost( arg: UInt16 ): UInt16; inline;
415 begin
416 CFSwapInt16LittleToHost := arg;
417 end;
418
CFSwapInt32LittleToHostnull419 function CFSwapInt32LittleToHost( arg: UInt32 ): UInt32; inline;
420 begin
421 CFSwapInt32LittleToHost := arg;
422 end;
423
CFSwapInt64LittleToHostnull424 function CFSwapInt64LittleToHost( arg: UInt64 ): UInt64; inline;
425 begin
426 CFSwapInt64LittleToHost := arg;
427 end;
428
CFSwapInt16HostToLittlenull429 function CFSwapInt16HostToLittle( arg: UInt16 ): UInt16; inline;
430 begin
431 CFSwapInt16HostToLittle := arg;
432 end;
433
CFSwapInt32HostToLittlenull434 function CFSwapInt32HostToLittle( arg: UInt32 ): UInt32; inline;
435 begin
436 CFSwapInt32HostToLittle := arg;
437 end;
438
CFSwapInt64HostToLittlenull439 function CFSwapInt64HostToLittle( arg: UInt64 ): UInt64; inline;
440 begin
441 CFSwapInt64HostToLittle := arg;
442 end;
443
CFSwapInt16BigToHostnull444 function CFSwapInt16BigToHost( arg: UInt16 ): UInt16; inline;
445 begin
446 CFSwapInt16BigToHost := CFSwapInt16(arg);
447 end;
448
CFSwapInt32BigToHostnull449 function CFSwapInt32BigToHost( arg: UInt32 ): UInt32; inline;
450 begin
451 CFSwapInt32BigToHost := CFSwapInt32(arg);
452 end;
453
CFSwapInt64BigToHostnull454 function CFSwapInt64BigToHost( arg: UInt64 ): UInt64; inline;
455 begin
456 CFSwapInt64BigToHost := CFSwapInt64(arg);
457 end;
458
CFSwapInt16HostToBignull459 function CFSwapInt16HostToBig( arg: UInt16 ): UInt16; inline;
460 begin
461 CFSwapInt16HostToBig := CFSwapInt16(arg);
462 end;
463
CFSwapInt32HostToBignull464 function CFSwapInt32HostToBig( arg: UInt32 ): UInt32; inline;
465 begin
466 CFSwapInt32HostToBig := CFSwapInt32(arg);
467 end;
468
CFSwapInt64HostToBignull469 function CFSwapInt64HostToBig( arg: UInt64 ): UInt64; inline;
470 begin
471 CFSwapInt64HostToBig := CFSwapInt64(arg);
472 end;
473
CFConvertFloat32HostToSwappednull474 function CFConvertFloat32HostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
475 begin
476 CFConvertFloat32HostToSwapped.v := CFSwapInt32(CFSwappedFloat32(arg).v);
477 end;
478
CFConvertFloat32SwappedToHostnull479 function CFConvertFloat32SwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
480 begin
481 CFConvertFloat32SwappedToHost := Float32(CFSwappedFloat32(CFSwapInt32(arg.v)));
482 end;
483
CFConvertFloat64HostToSwappednull484 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
485 begin
486 CFConvertFloat64HostToSwapped.v := CFSwapInt64(CFSwappedFloat64(arg).v);
487 end;
488
CFConvertFloat64SwappedToHostnull489 function CFConvertFloat64SwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
490 begin
491 CFConvertFloat64SwappedToHost := Float64(CFSwappedFloat64(CFSwapInt64(arg.v)));
492 end;
493
CFConvertFloatHostToSwappednull494 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
495 begin
496 CFConvertFloatHostToSwapped.v := CFSwapInt32(CFSwappedFloat32(arg).v);
497 end;
498
CFConvertFloatSwappedToHostnull499 function CFConvertFloatSwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
500 begin
501 CFConvertFloatSwappedToHost := Float32(CFSwappedFloat32(CFSwapInt32(arg.v)));
502 end;
503
CFConvertDoubleHostToSwappednull504 function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
505 begin
506 CFConvertDoubleHostToSwapped.v := CFSwapInt64(CFSwappedFloat64(arg).v);
507 end;
508
CFConvertDoubleSwappedToHostnull509 function CFConvertDoubleSwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
510 begin
511 CFConvertDoubleSwappedToHost := Float64(CFSwappedFloat64(CFSwapInt64(arg.v)));
512 end;
513 {$endc}
514
515
516 end.
517
518 {$endc} {not MACOSALLINCLUDE}
519