Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1395 lines
35 KiB

  1. /*
  2. File: Math64.h
  3. Contains: 64-bit integer math Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1994-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __MATH64__
  11. #define __MATH64__
  12. #ifndef __CONDITIONALMACROS__
  13. #include <ConditionalMacros.h>
  14. #endif
  15. #ifndef __MACTYPES__
  16. #include <MacTypes.h>
  17. #endif
  18. #if PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #if PRAGMA_IMPORT
  25. #pragma import on
  26. #endif
  27. #if TYPE_LONGLONG && TARGET_OS_WIN32
  28. #define S64Max() 9223372036854775807i64
  29. #elif TYPE_LONGLONG && defined(__MWERKS__) && (__MWERKS__ < 0x1800)
  30. #define S64Max() 9223372036854775807
  31. #else
  32. /*
  33. * S64Max()
  34. *
  35. * Discussion:
  36. * Returns largest possible SInt64 value
  37. *
  38. * Availability:
  39. * Non-Carbon CFM: available as macro/inline
  40. * CarbonLib: in CarbonLib 1.0 and later
  41. * Mac OS X: in version 10.0 and later
  42. */
  43. EXTERN_API_C( SInt64 )
  44. S64Max(void);
  45. #if TYPE_LONGLONG
  46. #ifdef __cplusplus
  47. inline DEFINE_API_C(SInt64 ) S64Max(void) { return 9223372036854775807LL; }
  48. #else
  49. #define S64Max() (9223372036854775807LL)
  50. #endif
  51. #endif
  52. #endif
  53. /*
  54. * S64Min()
  55. *
  56. * Discussion:
  57. * Returns smallest possible SInt64 value
  58. *
  59. * Availability:
  60. * Non-Carbon CFM: available as macro/inline
  61. * CarbonLib: in CarbonLib 1.0 and later
  62. * Mac OS X: in version 10.0 and later
  63. */
  64. EXTERN_API_C( SInt64 )
  65. S64Min(void);
  66. #if TYPE_LONGLONG
  67. #ifdef __cplusplus
  68. inline DEFINE_API_C(SInt64 ) S64Min(void) { return -S64Max() - 1; }
  69. #else
  70. #define S64Min() (-S64Max() - 1)
  71. #endif
  72. #endif
  73. /*
  74. * S64Add()
  75. *
  76. * Discussion:
  77. * Adds two integers, producing an integer result. If an overflow
  78. * occurs the result is congruent mod (2^64) as if the operands and
  79. * result were unsigned. No overflow is signaled.
  80. *
  81. * Availability:
  82. * Non-Carbon CFM: available as macro/inline
  83. * CarbonLib: in CarbonLib 1.0 and later
  84. * Mac OS X: in version 10.0 and later
  85. */
  86. EXTERN_API_C( SInt64 )
  87. S64Add(
  88. SInt64 left,
  89. SInt64 right);
  90. #if TYPE_LONGLONG
  91. #ifdef __cplusplus
  92. inline DEFINE_API_C(SInt64 ) S64Add(SInt64 left, SInt64 right) { return (SInt64)(left) + (SInt64)(right); }
  93. #else
  94. #define S64Add(left, right) ((SInt64)(left) + (SInt64)(right))
  95. #endif
  96. #endif
  97. /*
  98. * S64Subtract()
  99. *
  100. * Discussion:
  101. * Subtracts two integers, producing an integer result. If an
  102. * overflow occurs the result is congruent mod (2^64) as if the
  103. * operands and result were unsigned. No overflow is signaled.
  104. *
  105. * Availability:
  106. * Non-Carbon CFM: available as macro/inline
  107. * CarbonLib: in CarbonLib 1.0 and later
  108. * Mac OS X: in version 10.0 and later
  109. */
  110. EXTERN_API_C( SInt64 )
  111. S64Subtract(
  112. SInt64 left,
  113. SInt64 right);
  114. #if TYPE_LONGLONG
  115. #ifdef __cplusplus
  116. inline DEFINE_API_C(SInt64 ) S64Subtract(SInt64 left, SInt64 right) { return (SInt64)(left) - (SInt64)(right); }
  117. #else
  118. #define S64Subtract(left, right) ((SInt64)(left) - (SInt64)(right))
  119. #endif
  120. #endif
  121. /*
  122. * S64Negate()
  123. *
  124. * Discussion:
  125. * Returns the additive inverse of a signed number (i.e. it returns
  126. * 0 - the number). S64Negate (S64Min) is not representable (in
  127. * fact, it returns S64Min).
  128. *
  129. * Availability:
  130. * Non-Carbon CFM: available as macro/inline
  131. * CarbonLib: in CarbonLib 1.0 and later
  132. * Mac OS X: in version 10.0 and later
  133. */
  134. EXTERN_API_C( SInt64 )
  135. S64Negate(SInt64 value);
  136. #if TYPE_LONGLONG
  137. #ifdef __cplusplus
  138. inline DEFINE_API_C(SInt64 ) S64Negate(SInt64 value) { return -(SInt64)(value); }
  139. #else
  140. #define S64Negate(value) (-(SInt64)(value))
  141. #endif
  142. #endif
  143. #if !TYPE_LONGLONG
  144. /*
  145. * S64Absolute()
  146. *
  147. * Discussion:
  148. * Returns the absolute value of the number (i.e. the number if it
  149. * is positive, or 0 - the number if it is negative). Disabled for
  150. * compilers that support long long until llabs() is available
  151. * everywhere.
  152. *
  153. * Availability:
  154. * Non-Carbon CFM: available as macro/inline
  155. * CarbonLib: in CarbonLib 1.0 and later
  156. * Mac OS X: in version 10.0 and later
  157. */
  158. EXTERN_API_C( SInt64 )
  159. S64Absolute(SInt64 value);
  160. #if TYPE_LONGLONG
  161. #ifdef __cplusplus
  162. inline DEFINE_API_C(SInt64 ) S64Absolute(SInt64 value) { return llabs((SInt64)value); }
  163. #else
  164. #define S64Absolute(value) (llabs((SInt64)value))
  165. #endif
  166. #endif
  167. #endif /* !TYPE_LONGLONG */
  168. /*
  169. * S64Multiply()
  170. *
  171. * Discussion:
  172. * Multiplies two signed numbers, producing a signed result.
  173. * Overflow is ignored and the low-order part of the product is
  174. * returned. The sign of the result is not guaranteed to be correct
  175. * if the magnitude of the product is not representable.
  176. *
  177. * Availability:
  178. * Non-Carbon CFM: available as macro/inline
  179. * CarbonLib: in CarbonLib 1.0 and later
  180. * Mac OS X: in version 10.0 and later
  181. */
  182. EXTERN_API_C( SInt64 )
  183. S64Multiply(
  184. SInt64 left,
  185. SInt64 right);
  186. #if TYPE_LONGLONG
  187. #ifdef __cplusplus
  188. inline DEFINE_API_C(SInt64 ) S64Multiply(SInt64 left, SInt64 right) { return (SInt64)(left) * (SInt64)(right); }
  189. #else
  190. #define S64Multiply(left, right) ((SInt64)(left) * (SInt64)(right))
  191. #endif
  192. #endif
  193. /*
  194. * S64Mod()
  195. *
  196. * Discussion:
  197. * Returns the remainder of divide of dividend by divisor. The sign
  198. * of the remainder is the same as the sign of the dividend (i.e.,
  199. * it takes the absolute values of the operands, does the division,
  200. * then fixes the sign of the quotient and remainder).
  201. *
  202. * Availability:
  203. * Implemented by client
  204. */
  205. EXTERN_API_C( SInt64 )
  206. S64Mod(
  207. SInt64 dividend,
  208. SInt64 divisor);
  209. #if TYPE_LONGLONG
  210. #ifdef __cplusplus
  211. inline DEFINE_API_C(SInt64 ) S64Mod(SInt64 dividend, SInt64 divisor) { return (SInt64)(dividend) % (SInt64)(divisor); }
  212. #else
  213. #define S64Mod(dividend, divisor) ((SInt64)(dividend) % (SInt64)(divisor))
  214. #endif
  215. #endif
  216. /*
  217. * S64Divide()
  218. *
  219. * Discussion:
  220. * Divides dividend by divisor, returning the quotient. The
  221. * remainder is returned in *remainder if remainder (the pointer) is
  222. * non-NULL. The sign of the remainder is the same as the sign of
  223. * the dividend (i.e. it takes the absolute values of the operands,
  224. * does the division, then fixes the sign of the quotient and
  225. * remainder). If the divisor is zero, then S64Max() will be
  226. * returned (or S64Min() if the dividend is negative), and the
  227. * remainder will be the dividend; no error is reported.
  228. *
  229. * Availability:
  230. * Non-Carbon CFM: available as macro/inline
  231. * CarbonLib: in CarbonLib 1.0 and later
  232. * Mac OS X: in version 10.0 and later
  233. */
  234. EXTERN_API_C( SInt64 )
  235. S64Divide(
  236. SInt64 dividend,
  237. SInt64 divisor,
  238. SInt64 * remainder); /* can be NULL */
  239. #if TYPE_LONGLONG
  240. #ifdef __cplusplus
  241. inline DEFINE_API_C(SInt64 ) S64Divide(SInt64 dividend, SInt64 divisor, SInt64 *remainder) { return ( (void)((remainder) && (*((SInt64*)(remainder)) = ((SInt64)(dividend) % (SInt64)(divisor)))), ((SInt64)(dividend) / (SInt64)(divisor)) ); }
  242. #else
  243. #define S64Divide(dividend, divisor, remainder) (( (void)((remainder) && (*((SInt64*)(remainder)) = ((SInt64)(dividend) % (SInt64)(divisor)))), ((SInt64)(dividend) / (SInt64)(divisor)) ))
  244. #endif
  245. #endif
  246. /*
  247. * S64Div()
  248. *
  249. * Discussion:
  250. * Divides dividend by divisor, returning the quotient.
  251. *
  252. * Availability:
  253. * Implemented by client
  254. */
  255. EXTERN_API_C( SInt64 )
  256. S64Div(
  257. SInt64 dividend,
  258. SInt64 divisor);
  259. #if TYPE_LONGLONG
  260. #ifdef __cplusplus
  261. inline DEFINE_API_C(SInt64 ) S64Div(SInt64 dividend, SInt64 divisor) { return S64Divide((dividend), (divisor), NULL); }
  262. #else
  263. #define S64Div(dividend, divisor) (S64Divide((dividend), (divisor), NULL))
  264. #endif
  265. #endif
  266. /*
  267. * S64Set()
  268. *
  269. * Discussion:
  270. * Given an SInt32, returns an SInt64 with the same value. Use this
  271. * routine instead of coding 64-bit constants (at least when the
  272. * constant will fit in an SInt32).
  273. *
  274. * Availability:
  275. * Non-Carbon CFM: available as macro/inline
  276. * CarbonLib: in CarbonLib 1.0 and later
  277. * Mac OS X: in version 10.0 and later
  278. */
  279. EXTERN_API_C( SInt64 )
  280. S64Set(SInt32 value);
  281. #if TYPE_LONGLONG
  282. #ifdef __cplusplus
  283. inline DEFINE_API_C(SInt64 ) S64Set(SInt32 value) { return (SInt64)(value); }
  284. #else
  285. #define S64Set(value) ((SInt64)(value))
  286. #endif
  287. #endif
  288. /*
  289. * S64SetU()
  290. *
  291. * Discussion:
  292. * Given a UInt32, returns a SInt64 with the same value.
  293. *
  294. * Availability:
  295. * Non-Carbon CFM: available as macro/inline
  296. * CarbonLib: in CarbonLib 1.0 and later
  297. * Mac OS X: in version 10.0 and later
  298. */
  299. EXTERN_API_C( SInt64 )
  300. S64SetU(UInt32 value);
  301. #if TYPE_LONGLONG
  302. #ifdef __cplusplus
  303. inline DEFINE_API_C(SInt64 ) S64SetU(UInt32 value) { return (SInt64)(value); }
  304. #else
  305. #define S64SetU(value) ((SInt64)(value))
  306. #endif
  307. #endif
  308. /*
  309. * S32Set()
  310. *
  311. * Discussion:
  312. * Given an SInt64, returns an SInt32 by discarding the high-order
  313. * 32 bits.
  314. *
  315. * Availability:
  316. * Non-Carbon CFM: available as macro/inline
  317. * CarbonLib: in CarbonLib 1.0 and later
  318. * Mac OS X: in version 10.0 and later
  319. */
  320. EXTERN_API_C( SInt32 )
  321. S32Set(SInt64 value);
  322. #if TYPE_LONGLONG
  323. #ifdef __cplusplus
  324. inline DEFINE_API_C(SInt32 ) S32Set(SInt64 value) { return (SInt32)(value); }
  325. #else
  326. #define S32Set(value) ((SInt32)(value))
  327. #endif
  328. #endif
  329. /*
  330. * S64And()
  331. *
  332. * Discussion:
  333. * Returns one if left and right are non-zero, otherwise returns zero
  334. *
  335. * Availability:
  336. * Non-Carbon CFM: available as macro/inline
  337. * CarbonLib: in CarbonLib 1.0 and later
  338. * Mac OS X: in version 10.0 and later
  339. */
  340. EXTERN_API_C( Boolean )
  341. S64And(
  342. SInt64 left,
  343. SInt64 right);
  344. #if TYPE_LONGLONG
  345. #ifdef __cplusplus
  346. inline DEFINE_API_C(Boolean ) S64And(SInt64 left, SInt64 right) { return (SInt64)(left) && (SInt64)(right); }
  347. #else
  348. #define S64And(left, right) ((SInt64)(left) && (SInt64)(right))
  349. #endif
  350. #endif
  351. /*
  352. * S64Or()
  353. *
  354. * Discussion:
  355. * Returns one if left or right are non-zero, otherwise returns zero
  356. *
  357. * Availability:
  358. * Non-Carbon CFM: available as macro/inline
  359. * CarbonLib: in CarbonLib 1.0 and later
  360. * Mac OS X: in version 10.0 and later
  361. */
  362. EXTERN_API_C( Boolean )
  363. S64Or(
  364. SInt64 left,
  365. SInt64 right);
  366. #if TYPE_LONGLONG
  367. #ifdef __cplusplus
  368. inline DEFINE_API_C(Boolean ) S64Or(SInt64 left, SInt64 right) { return (SInt64)(left) || (SInt64)(right); }
  369. #else
  370. #define S64Or(left, right) ((SInt64)(left) || (SInt64)(right))
  371. #endif
  372. #endif
  373. /*
  374. * S64Eor()
  375. *
  376. * Discussion:
  377. * Returns one if left xor right are non-zero, otherwise returns zero
  378. *
  379. * Availability:
  380. * Non-Carbon CFM: available as macro/inline
  381. * CarbonLib: in CarbonLib 1.0 and later
  382. * Mac OS X: in version 10.0 and later
  383. */
  384. EXTERN_API_C( Boolean )
  385. S64Eor(
  386. SInt64 left,
  387. SInt64 right);
  388. #if TYPE_LONGLONG
  389. #ifdef __cplusplus
  390. inline DEFINE_API_C(Boolean ) S64Eor(SInt64 left, SInt64 right) { return (Boolean)(((SInt64)(left) ? 1 : 0) ^ ((SInt64)(right) ? 1 : 0)); }
  391. #else
  392. #define S64Eor(left, right) ((Boolean)(((SInt64)(left) ? 1 : 0) ^ ((SInt64)(right) ? 1 : 0)))
  393. #endif
  394. #endif
  395. /*
  396. * S64Not()
  397. *
  398. * Discussion:
  399. * Returns one if value is non-zero, otherwisze returns zero.
  400. *
  401. * Availability:
  402. * Non-Carbon CFM: available as macro/inline
  403. * CarbonLib: in CarbonLib 1.0 and later
  404. * Mac OS X: in version 10.0 and later
  405. */
  406. EXTERN_API_C( Boolean )
  407. S64Not(SInt64 value);
  408. #if TYPE_LONGLONG
  409. #ifdef __cplusplus
  410. inline DEFINE_API_C(Boolean ) S64Not(SInt64 value) { return !((SInt64)(value)); }
  411. #else
  412. #define S64Not(value) (!((SInt64)(value)))
  413. #endif
  414. #endif
  415. /*
  416. * S64Compare()
  417. *
  418. * Discussion:
  419. * Given two signed numbers, left and right, returns an SInt32 that
  420. * compares with zero the same way left compares with right. If you
  421. * wanted to perform a comparison on 64-bit integers of the
  422. * form:
  423. * operand_1 <operation> operand_2
  424. * then you could use an expression of the form:
  425. * xxxS64Compare(operand_1,operand_2) <operation> 0
  426. * to test for the same condition. CAUTION: DO NOT depend on the
  427. * exact value returned by this routine. Only the sign (i.e.
  428. * positive, zero, or negative) of the result is guaranteed.
  429. *
  430. * Availability:
  431. * Non-Carbon CFM: not available
  432. * CarbonLib: in CarbonLib 1.0 and later
  433. * Mac OS X: in version 10.0 and later
  434. */
  435. EXTERN_API_C( SInt32 )
  436. S64Compare(
  437. SInt64 left,
  438. SInt64 right);
  439. /*
  440. * S64BitwiseAnd()
  441. *
  442. * Discussion:
  443. * bitwise AND
  444. *
  445. * Availability:
  446. * Non-Carbon CFM: available as macro/inline
  447. * CarbonLib: in CarbonLib 1.0 and later
  448. * Mac OS X: in version 10.0 and later
  449. */
  450. EXTERN_API_C( SInt64 )
  451. S64BitwiseAnd(
  452. SInt64 left,
  453. SInt64 right);
  454. #if TYPE_LONGLONG
  455. #ifdef __cplusplus
  456. inline DEFINE_API_C(SInt64 ) S64BitwiseAnd(SInt64 left, SInt64 right) { return (SInt64)(left) & (SInt64)(right); }
  457. #else
  458. #define S64BitwiseAnd(left, right) ((SInt64)(left) & (SInt64)(right))
  459. #endif
  460. #endif
  461. /*
  462. * S64BitwiseOr()
  463. *
  464. * Discussion:
  465. * bitwise OR
  466. *
  467. * Availability:
  468. * Non-Carbon CFM: available as macro/inline
  469. * CarbonLib: in CarbonLib 1.0 and later
  470. * Mac OS X: in version 10.0 and later
  471. */
  472. EXTERN_API_C( SInt64 )
  473. S64BitwiseOr(
  474. SInt64 left,
  475. SInt64 right);
  476. #if TYPE_LONGLONG
  477. #ifdef __cplusplus
  478. inline DEFINE_API_C(SInt64 ) S64BitwiseOr(SInt64 left, SInt64 right) { return (SInt64)(left) | (SInt64)(right); }
  479. #else
  480. #define S64BitwiseOr(left, right) ((SInt64)(left) | (SInt64)(right))
  481. #endif
  482. #endif
  483. /*
  484. * S64BitwiseEor()
  485. *
  486. * Discussion:
  487. * bitwise XOR
  488. *
  489. * Availability:
  490. * Non-Carbon CFM: available as macro/inline
  491. * CarbonLib: in CarbonLib 1.0 and later
  492. * Mac OS X: in version 10.0 and later
  493. */
  494. EXTERN_API_C( SInt64 )
  495. S64BitwiseEor(
  496. SInt64 left,
  497. SInt64 right);
  498. #if TYPE_LONGLONG
  499. #ifdef __cplusplus
  500. inline DEFINE_API_C(SInt64 ) S64BitwiseEor(SInt64 left, SInt64 right) { return (SInt64)(left) ^ (SInt64)(right); }
  501. #else
  502. #define S64BitwiseEor(left, right) ((SInt64)(left) ^ (SInt64)(right))
  503. #endif
  504. #endif
  505. /*
  506. * S64BitwiseNot()
  507. *
  508. * Discussion:
  509. * bitwise negate
  510. *
  511. * Availability:
  512. * Non-Carbon CFM: available as macro/inline
  513. * CarbonLib: in CarbonLib 1.0 and later
  514. * Mac OS X: in version 10.0 and later
  515. */
  516. EXTERN_API_C( SInt64 )
  517. S64BitwiseNot(SInt64 value);
  518. #if TYPE_LONGLONG
  519. #ifdef __cplusplus
  520. inline DEFINE_API_C(SInt64 ) S64BitwiseNot(SInt64 value) { return ~((SInt64)(value)); }
  521. #else
  522. #define S64BitwiseNot(value) (~((SInt64)(value)))
  523. #endif
  524. #endif
  525. /*
  526. * S64ShiftRight()
  527. *
  528. * Discussion:
  529. * Arithmetic shift of value by the lower 7 bits of the shift.
  530. *
  531. * Availability:
  532. * Non-Carbon CFM: available as macro/inline
  533. * CarbonLib: in CarbonLib 1.0 and later
  534. * Mac OS X: in version 10.0 and later
  535. */
  536. EXTERN_API_C( SInt64 )
  537. S64ShiftRight(
  538. SInt64 value,
  539. UInt32 shift);
  540. #if TYPE_LONGLONG
  541. #ifdef __cplusplus
  542. inline DEFINE_API_C(SInt64 ) S64ShiftRight(SInt64 value, UInt32 shift) { return (SInt64)(value) >> ((shift) & 0x7F); }
  543. #else
  544. #define S64ShiftRight(value, shift) ((SInt64)(value) >> ((shift) & 0x7F))
  545. #endif
  546. #endif
  547. /*
  548. * S64ShiftLeft()
  549. *
  550. * Discussion:
  551. * Logical shift of value by the lower 7 bits of the shift.
  552. *
  553. * Availability:
  554. * Non-Carbon CFM: available as macro/inline
  555. * CarbonLib: in CarbonLib 1.0 and later
  556. * Mac OS X: in version 10.0 and later
  557. */
  558. EXTERN_API_C( SInt64 )
  559. S64ShiftLeft(
  560. SInt64 value,
  561. UInt32 shift);
  562. #if TYPE_LONGLONG
  563. #ifdef __cplusplus
  564. inline DEFINE_API_C(SInt64 ) S64ShiftLeft(SInt64 value, UInt32 shift) { return (SInt64)(value) << ((shift) & 0x7F); }
  565. #else
  566. #define S64ShiftLeft(value, shift) ((SInt64)(value) << ((shift) & 0x7F))
  567. #endif
  568. #endif
  569. #if !TYPE_LONGDOUBLE_IS_DOUBLE
  570. /*
  571. * SInt64ToLongDouble()
  572. *
  573. * Discussion:
  574. * Converts SInt64 to long double. Note all SInt64s fit exactly
  575. * into long doubles, thus, the binary -> decimal conversion
  576. * routines in fp.h can be used to achieve SInt64 -> long double ->
  577. * decimal conversions. Note: The function implementation assumes
  578. * long double is a 128-bit floating point on PowerPC and 80-bit
  579. * type on 68K
  580. *
  581. * Availability:
  582. * Non-Carbon CFM: available as macro/inline
  583. * CarbonLib: in CarbonLib 1.0 and later
  584. * Mac OS X: not available
  585. */
  586. EXTERN_API_C( long double )
  587. SInt64ToLongDouble(SInt64 value);
  588. #if TYPE_LONGLONG
  589. #ifdef __cplusplus
  590. inline DEFINE_API_C(long double ) SInt64ToLongDouble(SInt64 value) { return (long double)(value); }
  591. #else
  592. #define SInt64ToLongDouble(value) ((long double)(value))
  593. #endif
  594. #endif
  595. /*
  596. * LongDoubleToSInt64()
  597. *
  598. * Discussion:
  599. * Converts a long double to a SInt64. Any decimal string that fits
  600. * into a SInt64 can be converted exactly into a long double, using
  601. * the conversion routines found in fp.h. Then this routine can be
  602. * used to complete the conversion to SInt64. Note: The function
  603. * implementation assumes long double is a 128-bit floating point on
  604. * PowerPC and 80-bit type on 68K
  605. *
  606. * Availability:
  607. * Non-Carbon CFM: available as macro/inline
  608. * CarbonLib: in CarbonLib 1.0 and later
  609. * Mac OS X: not available
  610. */
  611. EXTERN_API_C( SInt64 )
  612. LongDoubleToSInt64(long double value);
  613. #if TYPE_LONGLONG
  614. #ifdef __cplusplus
  615. inline DEFINE_API_C(SInt64 ) LongDoubleToSInt64(long double value) { return (SInt64)(value); }
  616. #else
  617. #define LongDoubleToSInt64(value) ((SInt64)(value))
  618. #endif
  619. #endif
  620. #endif /* !TYPE_LONGDOUBLE_IS_DOUBLE */
  621. #if TYPE_LONGLONG && TARGET_OS_WIN32
  622. #define U64Max() 0xffffffffffffffffui64
  623. #elif TYPE_LONGLONG && defined(__MWERKS__) && (__MWERKS__ < 0x1800)
  624. #define U64Max() 0xffffffffffffffff
  625. #else
  626. /*
  627. * U64Max()
  628. *
  629. * Discussion:
  630. * Returns largest possible UInt64 value
  631. *
  632. * Availability:
  633. * Non-Carbon CFM: available as macro/inline
  634. * CarbonLib: in CarbonLib 1.0 and later
  635. * Mac OS X: in version 10.0 and later
  636. */
  637. EXTERN_API_C( UInt64 )
  638. U64Max(void);
  639. #if TYPE_LONGLONG
  640. #ifdef __cplusplus
  641. inline DEFINE_API_C(UInt64 ) U64Max(void) { return 0xffffffffffffffffULL; }
  642. #else
  643. #define U64Max() (0xffffffffffffffffULL)
  644. #endif
  645. #endif
  646. #endif
  647. /*
  648. * U64Add()
  649. *
  650. * Discussion:
  651. * Adds two unsigned integers, producing an integer result. If an
  652. * overflow occurs the result is congruent mod (2^64) as if the
  653. * operands and result were unsigned. No overflow is signaled.
  654. *
  655. * Availability:
  656. * Non-Carbon CFM: available as macro/inline
  657. * CarbonLib: in CarbonLib 1.0 and later
  658. * Mac OS X: in version 10.0 and later
  659. */
  660. EXTERN_API_C( UInt64 )
  661. U64Add(
  662. UInt64 left,
  663. UInt64 right);
  664. #if TYPE_LONGLONG
  665. #ifdef __cplusplus
  666. inline DEFINE_API_C(UInt64 ) U64Add(UInt64 left, UInt64 right) { return (UInt64)(left) + (UInt64)(right); }
  667. #else
  668. #define U64Add(left, right) ((UInt64)(left) + (UInt64)(right))
  669. #endif
  670. #endif
  671. /*
  672. * U64Subtract()
  673. *
  674. * Discussion:
  675. * Subtracts two unsigned integers, producing an integer result. If
  676. * an overflow occurs the result is congruent mod (2^64) as if the
  677. * operands and result were unsigned. No overflow is signaled.
  678. *
  679. * Availability:
  680. * Non-Carbon CFM: available as macro/inline
  681. * CarbonLib: in CarbonLib 1.0 and later
  682. * Mac OS X: in version 10.0 and later
  683. */
  684. EXTERN_API_C( UInt64 )
  685. U64Subtract(
  686. UInt64 left,
  687. UInt64 right);
  688. #if TYPE_LONGLONG
  689. #ifdef __cplusplus
  690. inline DEFINE_API_C(UInt64 ) U64Subtract(UInt64 left, UInt64 right) { return (UInt64)(left) - (UInt64)(right); }
  691. #else
  692. #define U64Subtract(left, right) ((UInt64)(left) - (UInt64)(right))
  693. #endif
  694. #endif
  695. /*
  696. * U64Multiply()
  697. *
  698. * Discussion:
  699. * Multiplies two unsigned numbers, producing a signed result.
  700. * Overflow is ignored and the low-order part of the product is
  701. * returned. The sign of the result is not guaranteed to be correct
  702. * if the magnitude of the product is not representable.
  703. *
  704. * Availability:
  705. * Non-Carbon CFM: available as macro/inline
  706. * CarbonLib: in CarbonLib 1.0 and later
  707. * Mac OS X: in version 10.0 and later
  708. */
  709. EXTERN_API_C( UInt64 )
  710. U64Multiply(
  711. UInt64 left,
  712. UInt64 right);
  713. #if TYPE_LONGLONG
  714. #ifdef __cplusplus
  715. inline DEFINE_API_C(UInt64 ) U64Multiply(UInt64 left, UInt64 right) { return (UInt64)(left) * (UInt64)(right); }
  716. #else
  717. #define U64Multiply(left, right) ((UInt64)(left) * (UInt64)(right))
  718. #endif
  719. #endif
  720. /*
  721. * U64Mod()
  722. *
  723. * Discussion:
  724. * Returns the remainder of divide of dividend by divisor. The sign
  725. * of the remainder is the same as the sign of the dividend (i.e.,
  726. * it takes the absolute values of the operands, does the division,
  727. * then fixes the sign of the quotient and remainder).
  728. *
  729. * Availability:
  730. * Implemented by client
  731. */
  732. EXTERN_API_C( UInt64 )
  733. U64Mod(
  734. UInt64 dividend,
  735. UInt64 divisor);
  736. #if TYPE_LONGLONG
  737. #ifdef __cplusplus
  738. inline DEFINE_API_C(UInt64 ) U64Mod(UInt64 dividend, UInt64 divisor) { return (UInt64)(dividend) % (UInt64)(divisor); }
  739. #else
  740. #define U64Mod(dividend, divisor) ((UInt64)(dividend) % (UInt64)(divisor))
  741. #endif
  742. #endif
  743. /*
  744. * U64Divide()
  745. *
  746. * Discussion:
  747. * Divides dividend by divisor, returning the quotient. The
  748. * remainder is returned in *remainder if remainder (the pointer) is
  749. * non-NULL. The sign of the remainder is the same as the sign of
  750. * the dividend (i.e. it takes the absolute values of the operands,
  751. * does the division, then fixes the sign of the quotient and
  752. * remainder). If the divisor is zero, then U64Max() will be
  753. * returned (or U64Min() if the dividend is negative), and the
  754. * remainder will be the dividend; no error is reported.
  755. *
  756. * Availability:
  757. * Non-Carbon CFM: available as macro/inline
  758. * CarbonLib: in CarbonLib 1.0 and later
  759. * Mac OS X: in version 10.0 and later
  760. */
  761. EXTERN_API_C( UInt64 )
  762. U64Divide(
  763. UInt64 dividend,
  764. UInt64 divisor,
  765. UInt64 * remainder); /* can be NULL */
  766. #if TYPE_LONGLONG
  767. #ifdef __cplusplus
  768. inline DEFINE_API_C(UInt64 ) U64Divide(UInt64 dividend, UInt64 divisor, UInt64 *remainder) { return ( (void)((remainder) && (*((UInt64*)(remainder)) = ((UInt64)(dividend) % (UInt64)(divisor)))), ((UInt64)(dividend) / (UInt64)(divisor)) ); }
  769. #else
  770. #define U64Divide(dividend, divisor, remainder) (( (void)((remainder) && (*((UInt64*)(remainder)) = ((UInt64)(dividend) % (UInt64)(divisor)))), ((UInt64)(dividend) / (UInt64)(divisor)) ))
  771. #endif
  772. #endif
  773. /*
  774. * U64Div()
  775. *
  776. * Discussion:
  777. * Divides dividend by divisor, returning the quotient.
  778. *
  779. * Availability:
  780. * Implemented by client
  781. */
  782. EXTERN_API_C( UInt64 )
  783. U64Div(
  784. UInt64 dividend,
  785. UInt64 divisor);
  786. #if TYPE_LONGLONG
  787. #ifdef __cplusplus
  788. inline DEFINE_API_C(UInt64 ) U64Div(UInt64 dividend, UInt64 divisor) { return U64Divide((dividend), (divisor), NULL); }
  789. #else
  790. #define U64Div(dividend, divisor) (U64Divide((dividend), (divisor), NULL))
  791. #endif
  792. #endif
  793. /*
  794. * U64Set()
  795. *
  796. * Discussion:
  797. * Given an SInt32, returns an UInt64 with the same value. Use this
  798. * routine instead of coding 64-bit constants (at least when the
  799. * constant will fit in an SInt32).
  800. *
  801. * Availability:
  802. * Non-Carbon CFM: available as macro/inline
  803. * CarbonLib: in CarbonLib 1.0 and later
  804. * Mac OS X: in version 10.0 and later
  805. */
  806. EXTERN_API_C( UInt64 )
  807. U64Set(SInt32 value);
  808. #if TYPE_LONGLONG
  809. #ifdef __cplusplus
  810. inline DEFINE_API_C(UInt64 ) U64Set(SInt32 value) { return (UInt64)(value); }
  811. #else
  812. #define U64Set(value) ((UInt64)(value))
  813. #endif
  814. #endif
  815. /*
  816. * U64SetU()
  817. *
  818. * Discussion:
  819. * Given a UInt32, returns a UInt64 with the same value.
  820. *
  821. * Availability:
  822. * Non-Carbon CFM: available as macro/inline
  823. * CarbonLib: in CarbonLib 1.0 and later
  824. * Mac OS X: in version 10.0 and later
  825. */
  826. EXTERN_API_C( UInt64 )
  827. U64SetU(UInt32 value);
  828. #if TYPE_LONGLONG
  829. #ifdef __cplusplus
  830. inline DEFINE_API_C(UInt64 ) U64SetU(UInt32 value) { return (UInt64)(value); }
  831. #else
  832. #define U64SetU(value) ((UInt64)(value))
  833. #endif
  834. #endif
  835. /*
  836. * U32SetU()
  837. *
  838. * Discussion:
  839. * Given an UInt64, returns an UInt32 by discarding the high-order
  840. * 32 bits.
  841. *
  842. * Availability:
  843. * Non-Carbon CFM: available as macro/inline
  844. * CarbonLib: in CarbonLib 1.0 and later
  845. * Mac OS X: in version 10.0 and later
  846. */
  847. EXTERN_API_C( UInt32 )
  848. U32SetU(UInt64 value);
  849. #if TYPE_LONGLONG
  850. #ifdef __cplusplus
  851. inline DEFINE_API_C(UInt32 ) U32SetU(UInt64 value) { return (UInt32)(value); }
  852. #else
  853. #define U32SetU(value) ((UInt32)(value))
  854. #endif
  855. #endif
  856. /*
  857. * U64And()
  858. *
  859. * Discussion:
  860. * Returns one if left and right are non-zero, otherwise returns zero
  861. *
  862. * Availability:
  863. * Non-Carbon CFM: available as macro/inline
  864. * CarbonLib: in CarbonLib 1.0 and later
  865. * Mac OS X: in version 10.0 and later
  866. */
  867. EXTERN_API_C( Boolean )
  868. U64And(
  869. UInt64 left,
  870. UInt64 right);
  871. #if TYPE_LONGLONG
  872. #ifdef __cplusplus
  873. inline DEFINE_API_C(Boolean ) U64And(UInt64 left, UInt64 right) { return (UInt64)(left) && (UInt64)(right); }
  874. #else
  875. #define U64And(left, right) ((UInt64)(left) && (UInt64)(right))
  876. #endif
  877. #endif
  878. /*
  879. * U64Or()
  880. *
  881. * Discussion:
  882. * Returns one if left or right are non-zero, otherwise returns zero
  883. *
  884. * Availability:
  885. * Non-Carbon CFM: available as macro/inline
  886. * CarbonLib: in CarbonLib 1.0 and later
  887. * Mac OS X: in version 10.0 and later
  888. */
  889. EXTERN_API_C( Boolean )
  890. U64Or(
  891. UInt64 left,
  892. UInt64 right);
  893. #if TYPE_LONGLONG
  894. #ifdef __cplusplus
  895. inline DEFINE_API_C(Boolean ) U64Or(UInt64 left, UInt64 right) { return (UInt64)(left) || (UInt64)(right); }
  896. #else
  897. #define U64Or(left, right) ((UInt64)(left) || (UInt64)(right))
  898. #endif
  899. #endif
  900. /*
  901. * U64Eor()
  902. *
  903. * Discussion:
  904. * Returns one if left xor right are non-zero, otherwise returns zero
  905. *
  906. * Availability:
  907. * Non-Carbon CFM: available as macro/inline
  908. * CarbonLib: in CarbonLib 1.0 and later
  909. * Mac OS X: in version 10.0 and later
  910. */
  911. EXTERN_API_C( Boolean )
  912. U64Eor(
  913. UInt64 left,
  914. UInt64 right);
  915. #if TYPE_LONGLONG
  916. #ifdef __cplusplus
  917. inline DEFINE_API_C(Boolean ) U64Eor(UInt64 left, UInt64 right) { return (Boolean)(((UInt64)(left) ? 1 : 0) ^ ((UInt64)(right) ? 1 : 0)); }
  918. #else
  919. #define U64Eor(left, right) ((Boolean)(((UInt64)(left) ? 1 : 0) ^ ((UInt64)(right) ? 1 : 0)))
  920. #endif
  921. #endif
  922. /*
  923. * U64Not()
  924. *
  925. * Discussion:
  926. * Returns one if value is non-zero, otherwisze returns zero.
  927. *
  928. * Availability:
  929. * Non-Carbon CFM: available as macro/inline
  930. * CarbonLib: in CarbonLib 1.0 and later
  931. * Mac OS X: in version 10.0 and later
  932. */
  933. EXTERN_API_C( Boolean )
  934. U64Not(UInt64 value);
  935. #if TYPE_LONGLONG
  936. #ifdef __cplusplus
  937. inline DEFINE_API_C(Boolean ) U64Not(UInt64 value) { return !((UInt64)(value)); }
  938. #else
  939. #define U64Not(value) (!((UInt64)(value)))
  940. #endif
  941. #endif
  942. /*
  943. * U64Compare()
  944. *
  945. * Discussion:
  946. * Given two unsigned numbers, left and right, returns an SInt32
  947. * that compares with zero the same way left compares with right.
  948. * If you wanted to perform a comparison on 64-bit integers of the
  949. * form:
  950. * operand_1 <operation> operand_2
  951. * then you could use an expression of the form:
  952. * xxxU64Compare(operand_1,operand_2) <operation> 0
  953. * to test for the same condition. CAUTION: DO NOT depend on the
  954. * exact value returned by this routine. Only the sign (i.e.
  955. * positive, zero, or negative) of the result is guaranteed.
  956. *
  957. * Availability:
  958. * Non-Carbon CFM: not available
  959. * CarbonLib: in CarbonLib 1.0 and later
  960. * Mac OS X: in version 10.0 and later
  961. */
  962. EXTERN_API_C( SInt32 )
  963. U64Compare(
  964. UInt64 left,
  965. UInt64 right);
  966. /*
  967. * U64BitwiseAnd()
  968. *
  969. * Discussion:
  970. * bitwise AND
  971. *
  972. * Availability:
  973. * Non-Carbon CFM: available as macro/inline
  974. * CarbonLib: in CarbonLib 1.0 and later
  975. * Mac OS X: in version 10.0 and later
  976. */
  977. EXTERN_API_C( UInt64 )
  978. U64BitwiseAnd(
  979. UInt64 left,
  980. UInt64 right);
  981. #if TYPE_LONGLONG
  982. #ifdef __cplusplus
  983. inline DEFINE_API_C(UInt64 ) U64BitwiseAnd(UInt64 left, UInt64 right) { return (UInt64)(left) & (UInt64)(right); }
  984. #else
  985. #define U64BitwiseAnd(left, right) ((UInt64)(left) & (UInt64)(right))
  986. #endif
  987. #endif
  988. /*
  989. * U64BitwiseOr()
  990. *
  991. * Discussion:
  992. * bitwise OR
  993. *
  994. * Availability:
  995. * Non-Carbon CFM: available as macro/inline
  996. * CarbonLib: in CarbonLib 1.0 and later
  997. * Mac OS X: in version 10.0 and later
  998. */
  999. EXTERN_API_C( UInt64 )
  1000. U64BitwiseOr(
  1001. UInt64 left,
  1002. UInt64 right);
  1003. #if TYPE_LONGLONG
  1004. #ifdef __cplusplus
  1005. inline DEFINE_API_C(UInt64 ) U64BitwiseOr(UInt64 left, UInt64 right) { return (UInt64)(left) | (UInt64)(right); }
  1006. #else
  1007. #define U64BitwiseOr(left, right) ((UInt64)(left) | (UInt64)(right))
  1008. #endif
  1009. #endif
  1010. /*
  1011. * U64BitwiseEor()
  1012. *
  1013. * Discussion:
  1014. * bitwise XOR
  1015. *
  1016. * Availability:
  1017. * Non-Carbon CFM: available as macro/inline
  1018. * CarbonLib: in CarbonLib 1.0 and later
  1019. * Mac OS X: in version 10.0 and later
  1020. */
  1021. EXTERN_API_C( UInt64 )
  1022. U64BitwiseEor(
  1023. UInt64 left,
  1024. UInt64 right);
  1025. #if TYPE_LONGLONG
  1026. #ifdef __cplusplus
  1027. inline DEFINE_API_C(UInt64 ) U64BitwiseEor(UInt64 left, UInt64 right) { return (UInt64)(left) ^ (UInt64)(right); }
  1028. #else
  1029. #define U64BitwiseEor(left, right) ((UInt64)(left) ^ (UInt64)(right))
  1030. #endif
  1031. #endif
  1032. /*
  1033. * U64BitwiseNot()
  1034. *
  1035. * Discussion:
  1036. * bitwise negate
  1037. *
  1038. * Availability:
  1039. * Non-Carbon CFM: available as macro/inline
  1040. * CarbonLib: in CarbonLib 1.0 and later
  1041. * Mac OS X: in version 10.0 and later
  1042. */
  1043. EXTERN_API_C( UInt64 )
  1044. U64BitwiseNot(UInt64 value);
  1045. #if TYPE_LONGLONG
  1046. #ifdef __cplusplus
  1047. inline DEFINE_API_C(UInt64 ) U64BitwiseNot(UInt64 value) { return ~((UInt64)(value)); }
  1048. #else
  1049. #define U64BitwiseNot(value) (~((UInt64)(value)))
  1050. #endif
  1051. #endif
  1052. /*
  1053. * U64ShiftRight()
  1054. *
  1055. * Discussion:
  1056. * Arithmetic shift of value by the lower 7 bits of the shift.
  1057. *
  1058. * Availability:
  1059. * Non-Carbon CFM: available as macro/inline
  1060. * CarbonLib: in CarbonLib 1.0 and later
  1061. * Mac OS X: in version 10.0 and later
  1062. */
  1063. EXTERN_API_C( UInt64 )
  1064. U64ShiftRight(
  1065. UInt64 value,
  1066. UInt32 shift);
  1067. #if TYPE_LONGLONG
  1068. #ifdef __cplusplus
  1069. inline DEFINE_API_C(UInt64 ) U64ShiftRight(UInt64 value, UInt32 shift) { return (UInt64)(value) >> ((shift) & 0x7F); }
  1070. #else
  1071. #define U64ShiftRight(value, shift) ((UInt64)(value) >> ((shift) & 0x7F))
  1072. #endif
  1073. #endif
  1074. /*
  1075. * U64ShiftLeft()
  1076. *
  1077. * Discussion:
  1078. * Logical shift of value by the lower 7 bits of the shift.
  1079. *
  1080. * Availability:
  1081. * Non-Carbon CFM: available as macro/inline
  1082. * CarbonLib: in CarbonLib 1.0 and later
  1083. * Mac OS X: in version 10.0 and later
  1084. */
  1085. EXTERN_API_C( UInt64 )
  1086. U64ShiftLeft(
  1087. UInt64 value,
  1088. UInt32 shift);
  1089. #if TYPE_LONGLONG
  1090. #ifdef __cplusplus
  1091. inline DEFINE_API_C(UInt64 ) U64ShiftLeft(UInt64 value, UInt32 shift) { return (UInt64)(value) << ((shift) & 0x7F); }
  1092. #else
  1093. #define U64ShiftLeft(value, shift) ((UInt64)(value) << ((shift) & 0x7F))
  1094. #endif
  1095. #endif
  1096. #if !TYPE_LONGDOUBLE_IS_DOUBLE
  1097. /*
  1098. * UInt64ToLongDouble()
  1099. *
  1100. * Discussion:
  1101. * Convert an signed 64 bit integer to a long double (128-bit on
  1102. * PowerPC floating point)
  1103. *
  1104. * Availability:
  1105. * Non-Carbon CFM: available as macro/inline
  1106. * CarbonLib: in CarbonLib 1.0 and later
  1107. * Mac OS X: not available
  1108. */
  1109. EXTERN_API_C( long double )
  1110. UInt64ToLongDouble(UInt64 value);
  1111. #if TYPE_LONGLONG
  1112. #ifdef __cplusplus
  1113. inline DEFINE_API_C(long double ) UInt64ToLongDouble(UInt64 value) { return (long double)(value); }
  1114. #else
  1115. #define UInt64ToLongDouble(value) ((long double)(value))
  1116. #endif
  1117. #endif
  1118. /*
  1119. * LongDoubleToUInt64()
  1120. *
  1121. * Discussion:
  1122. * Convert long double (128-bit on PowerPC floating point) to a
  1123. * signed 64-bit integer
  1124. *
  1125. * Availability:
  1126. * Non-Carbon CFM: available as macro/inline
  1127. * CarbonLib: in CarbonLib 1.0 and later
  1128. * Mac OS X: not available
  1129. */
  1130. EXTERN_API_C( UInt64 )
  1131. LongDoubleToUInt64(long double value);
  1132. #if TYPE_LONGLONG
  1133. #ifdef __cplusplus
  1134. inline DEFINE_API_C(UInt64 ) LongDoubleToUInt64(long double value) { return (UInt64)(value); }
  1135. #else
  1136. #define LongDoubleToUInt64(value) ((UInt64)(value))
  1137. #endif
  1138. #endif
  1139. #endif /* !TYPE_LONGDOUBLE_IS_DOUBLE */
  1140. /*
  1141. * UInt64ToSInt64()
  1142. *
  1143. * Discussion:
  1144. * converts UInt64 -> SInt64
  1145. *
  1146. * Availability:
  1147. * Non-Carbon CFM: available as macro/inline
  1148. * CarbonLib: in CarbonLib 1.0 and later
  1149. * Mac OS X: in version 10.0 and later
  1150. */
  1151. EXTERN_API_C( SInt64 )
  1152. UInt64ToSInt64(UInt64 value);
  1153. #if TYPE_LONGLONG
  1154. #ifdef __cplusplus
  1155. inline DEFINE_API_C(SInt64 ) UInt64ToSInt64(UInt64 value) { return (SInt64)(value); }
  1156. #else
  1157. #define UInt64ToSInt64(value) ((SInt64)(value))
  1158. #endif
  1159. #endif
  1160. /*
  1161. * SInt64ToUInt64()
  1162. *
  1163. * Discussion:
  1164. * converts SInt64 -> UInt64
  1165. *
  1166. * Availability:
  1167. * Non-Carbon CFM: available as macro/inline
  1168. * CarbonLib: in CarbonLib 1.0 and later
  1169. * Mac OS X: in version 10.0 and later
  1170. */
  1171. EXTERN_API_C( UInt64 )
  1172. SInt64ToUInt64(SInt64 value);
  1173. #if TYPE_LONGLONG
  1174. #ifdef __cplusplus
  1175. inline DEFINE_API_C(UInt64 ) SInt64ToUInt64(SInt64 value) { return (UInt64)(value); }
  1176. #else
  1177. #define SInt64ToUInt64(value) ((UInt64)(value))
  1178. #endif
  1179. #endif
  1180. /*
  1181. Functions to convert between [Unsigned]Wide and [S|U]Int64 types.
  1182. These functions are necessary if source code which uses both
  1183. wide and SInt64 is to compile under a compiler that supports
  1184. long long.
  1185. SInt64ToWide
  1186. Converts a SInt64 to a wide struct. If SInt64 is implemented
  1187. as a typedef of wide, the macro does nothing. If SInt64 is
  1188. implemented as a long long, it casts the long long into a
  1189. wide struct.
  1190. WideToSInt64
  1191. Converts a wide struct into a SInt64. If SInt64 is implemented
  1192. as a typedef of wide, the macro does nothing. If SInt64 is
  1193. implemented as a long long, it reads the struct into a long long.
  1194. */
  1195. #if TYPE_LONGLONG
  1196. #define SInt64ToWide(x) (*((wide*)(&(x))))
  1197. #define WideToSInt64(x) (*((SInt64*)(&(x))))
  1198. #define UInt64ToUnsignedWide(x) (*((UnsignedWide*)(&(x))))
  1199. #define UnsignedWideToUInt64(x) (*((UInt64*)(&(x))))
  1200. #else
  1201. #define SInt64ToWide(x) (x)
  1202. #define WideToSInt64(x) (x)
  1203. #define UInt64ToUnsignedWide(x) (x)
  1204. #define UnsignedWideToUInt64(x) (x)
  1205. #endif
  1206. #ifdef PRAGMA_IMPORT_OFF
  1207. #pragma import off
  1208. #elif PRAGMA_IMPORT
  1209. #pragma import reset
  1210. #endif
  1211. #ifdef __cplusplus
  1212. }
  1213. #endif
  1214. #endif /* __MATH64__ */