SDL_mslibc.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #include "SDL_internal.h"
  19. /* This file contains SDL replacements for functions in the C library */
  20. #if !defined(HAVE_LIBC) && !defined(SDL_STATIC_LIB)
  21. /* These are some C runtime intrinsics that need to be defined */
  22. #ifdef _MSC_VER
  23. #ifndef __FLTUSED__
  24. #define __FLTUSED__
  25. __declspec(selectany) int _fltused = 1;
  26. #endif
  27. /* The optimizer on Visual Studio 2005 and later generates memcpy() and memset() calls.
  28. Always provide it for the SDL3 DLL, but skip it when building static lib w/ static runtime. */
  29. #if (_MSC_VER >= 1400) && (!defined(_MT) || defined(DLL_EXPORT))
  30. /* NOLINTNEXTLINE(readability-redundant-declaration) */
  31. extern void *memcpy(void *dst, const void *src, size_t len);
  32. #ifndef __INTEL_LLVM_COMPILER
  33. #pragma intrinsic(memcpy)
  34. #endif
  35. #ifndef __clang__
  36. #pragma function(memcpy)
  37. #endif
  38. /* NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) */
  39. void *memcpy(void *dst, const void *src, size_t len)
  40. {
  41. return SDL_memcpy(dst, src, len);
  42. }
  43. /* NOLINTNEXTLINE(readability-redundant-declaration) */
  44. extern void *memset(void *dst, int c, size_t len);
  45. #ifndef __INTEL_LLVM_COMPILER
  46. #pragma intrinsic(memset)
  47. #endif
  48. #ifndef __clang__
  49. #pragma function(memset)
  50. #endif
  51. /* NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) */
  52. void *memset(void *dst, int c, size_t len)
  53. {
  54. return SDL_memset(dst, c, len);
  55. }
  56. #endif /* (_MSC_VER >= 1400) && (!defined(_MT) || defined(DLL_EXPORT)) */
  57. #ifdef _M_IX86
  58. /* Float to long */
  59. void __declspec(naked) _ftol()
  60. {
  61. /* *INDENT-OFF* */
  62. __asm {
  63. push ebp
  64. mov ebp,esp
  65. sub esp,20h
  66. and esp,0FFFFFFF0h
  67. fld st(0)
  68. fst dword ptr [esp+18h]
  69. fistp qword ptr [esp+10h]
  70. fild qword ptr [esp+10h]
  71. mov edx,dword ptr [esp+18h]
  72. mov eax,dword ptr [esp+10h]
  73. test eax,eax
  74. je integer_QnaN_or_zero
  75. arg_is_not_integer_QnaN:
  76. fsubp st(1),st
  77. test edx,edx
  78. jns positive
  79. fstp dword ptr [esp]
  80. mov ecx,dword ptr [esp]
  81. xor ecx,80000000h
  82. add ecx,7FFFFFFFh
  83. adc eax,0
  84. mov edx,dword ptr [esp+14h]
  85. adc edx,0
  86. jmp localexit
  87. positive:
  88. fstp dword ptr [esp]
  89. mov ecx,dword ptr [esp]
  90. add ecx,7FFFFFFFh
  91. sbb eax,0
  92. mov edx,dword ptr [esp+14h]
  93. sbb edx,0
  94. jmp localexit
  95. integer_QnaN_or_zero:
  96. mov edx,dword ptr [esp+14h]
  97. test edx,7FFFFFFFh
  98. jne arg_is_not_integer_QnaN
  99. fstp dword ptr [esp+18h]
  100. fstp dword ptr [esp+18h]
  101. localexit:
  102. leave
  103. ret
  104. }
  105. /* *INDENT-ON* */
  106. }
  107. void _ftol2_sse()
  108. {
  109. _ftol();
  110. }
  111. void _ftol2()
  112. {
  113. _ftol();
  114. }
  115. /* 64-bit math operators for 32-bit systems */
  116. void __declspec(naked) _allmul()
  117. {
  118. /* *INDENT-OFF* */
  119. __asm {
  120. mov eax, dword ptr[esp+8]
  121. mov ecx, dword ptr[esp+10h]
  122. or ecx, eax
  123. mov ecx, dword ptr[esp+0Ch]
  124. jne hard
  125. mov eax, dword ptr[esp+4]
  126. mul ecx
  127. ret 10h
  128. hard:
  129. push ebx
  130. mul ecx
  131. mov ebx, eax
  132. mov eax, dword ptr[esp+8]
  133. mul dword ptr[esp+14h]
  134. add ebx, eax
  135. mov eax, dword ptr[esp+8]
  136. mul ecx
  137. add edx, ebx
  138. pop ebx
  139. ret 10h
  140. }
  141. /* *INDENT-ON* */
  142. }
  143. void __declspec(naked) _alldiv()
  144. {
  145. /* *INDENT-OFF* */
  146. __asm {
  147. push edi
  148. push esi
  149. push ebx
  150. xor edi,edi
  151. mov eax,dword ptr [esp+14h]
  152. or eax,eax
  153. jge L1
  154. inc edi
  155. mov edx,dword ptr [esp+10h]
  156. neg eax
  157. neg edx
  158. sbb eax,0
  159. mov dword ptr [esp+14h],eax
  160. mov dword ptr [esp+10h],edx
  161. L1:
  162. mov eax,dword ptr [esp+1Ch]
  163. or eax,eax
  164. jge L2
  165. inc edi
  166. mov edx,dword ptr [esp+18h]
  167. neg eax
  168. neg edx
  169. sbb eax,0
  170. mov dword ptr [esp+1Ch],eax
  171. mov dword ptr [esp+18h],edx
  172. L2:
  173. or eax,eax
  174. jne L3
  175. mov ecx,dword ptr [esp+18h]
  176. mov eax,dword ptr [esp+14h]
  177. xor edx,edx
  178. div ecx
  179. mov ebx,eax
  180. mov eax,dword ptr [esp+10h]
  181. div ecx
  182. mov edx,ebx
  183. jmp L4
  184. L3:
  185. mov ebx,eax
  186. mov ecx,dword ptr [esp+18h]
  187. mov edx,dword ptr [esp+14h]
  188. mov eax,dword ptr [esp+10h]
  189. L5:
  190. shr ebx,1
  191. rcr ecx,1
  192. shr edx,1
  193. rcr eax,1
  194. or ebx,ebx
  195. jne L5
  196. div ecx
  197. mov esi,eax
  198. mul dword ptr [esp+1Ch]
  199. mov ecx,eax
  200. mov eax,dword ptr [esp+18h]
  201. mul esi
  202. add edx,ecx
  203. jb L6
  204. cmp edx,dword ptr [esp+14h]
  205. ja L6
  206. jb L7
  207. cmp eax,dword ptr [esp+10h]
  208. jbe L7
  209. L6:
  210. dec esi
  211. L7:
  212. xor edx,edx
  213. mov eax,esi
  214. L4:
  215. dec edi
  216. jne L8
  217. neg edx
  218. neg eax
  219. sbb edx,0
  220. L8:
  221. pop ebx
  222. pop esi
  223. pop edi
  224. ret 10h
  225. }
  226. /* *INDENT-ON* */
  227. }
  228. void __declspec(naked) _aulldiv()
  229. {
  230. /* *INDENT-OFF* */
  231. __asm {
  232. push ebx
  233. push esi
  234. mov eax,dword ptr [esp+18h]
  235. or eax,eax
  236. jne L1
  237. mov ecx,dword ptr [esp+14h]
  238. mov eax,dword ptr [esp+10h]
  239. xor edx,edx
  240. div ecx
  241. mov ebx,eax
  242. mov eax,dword ptr [esp+0Ch]
  243. div ecx
  244. mov edx,ebx
  245. jmp L2
  246. L1:
  247. mov ecx,eax
  248. mov ebx,dword ptr [esp+14h]
  249. mov edx,dword ptr [esp+10h]
  250. mov eax,dword ptr [esp+0Ch]
  251. L3:
  252. shr ecx,1
  253. rcr ebx,1
  254. shr edx,1
  255. rcr eax,1
  256. or ecx,ecx
  257. jne L3
  258. div ebx
  259. mov esi,eax
  260. mul dword ptr [esp+18h]
  261. mov ecx,eax
  262. mov eax,dword ptr [esp+14h]
  263. mul esi
  264. add edx,ecx
  265. jb L4
  266. cmp edx,dword ptr [esp+10h]
  267. ja L4
  268. jb L5
  269. cmp eax,dword ptr [esp+0Ch]
  270. jbe L5
  271. L4:
  272. dec esi
  273. L5:
  274. xor edx,edx
  275. mov eax,esi
  276. L2:
  277. pop esi
  278. pop ebx
  279. ret 10h
  280. }
  281. /* *INDENT-ON* */
  282. }
  283. void __declspec(naked) _allrem()
  284. {
  285. /* *INDENT-OFF* */
  286. __asm {
  287. push ebx
  288. push edi
  289. xor edi,edi
  290. mov eax,dword ptr [esp+10h]
  291. or eax,eax
  292. jge L1
  293. inc edi
  294. mov edx,dword ptr [esp+0Ch]
  295. neg eax
  296. neg edx
  297. sbb eax,0
  298. mov dword ptr [esp+10h],eax
  299. mov dword ptr [esp+0Ch],edx
  300. L1:
  301. mov eax,dword ptr [esp+18h]
  302. or eax,eax
  303. jge L2
  304. mov edx,dword ptr [esp+14h]
  305. neg eax
  306. neg edx
  307. sbb eax,0
  308. mov dword ptr [esp+18h],eax
  309. mov dword ptr [esp+14h],edx
  310. L2:
  311. or eax,eax
  312. jne L3
  313. mov ecx,dword ptr [esp+14h]
  314. mov eax,dword ptr [esp+10h]
  315. xor edx,edx
  316. div ecx
  317. mov eax,dword ptr [esp+0Ch]
  318. div ecx
  319. mov eax,edx
  320. xor edx,edx
  321. dec edi
  322. jns L4
  323. jmp L8
  324. L3:
  325. mov ebx,eax
  326. mov ecx,dword ptr [esp+14h]
  327. mov edx,dword ptr [esp+10h]
  328. mov eax,dword ptr [esp+0Ch]
  329. L5:
  330. shr ebx,1
  331. rcr ecx,1
  332. shr edx,1
  333. rcr eax,1
  334. or ebx,ebx
  335. jne L5
  336. div ecx
  337. mov ecx,eax
  338. mul dword ptr [esp+18h]
  339. xchg eax,ecx
  340. mul dword ptr [esp+14h]
  341. add edx,ecx
  342. jb L6
  343. cmp edx,dword ptr [esp+10h]
  344. ja L6
  345. jb L7
  346. cmp eax,dword ptr [esp+0Ch]
  347. jbe L7
  348. L6:
  349. sub eax,dword ptr [esp+14h]
  350. sbb edx,dword ptr [esp+18h]
  351. L7:
  352. sub eax,dword ptr [esp+0Ch]
  353. sbb edx,dword ptr [esp+10h]
  354. dec edi
  355. jns L8
  356. L4:
  357. neg edx
  358. neg eax
  359. sbb edx,0
  360. L8:
  361. pop edi
  362. pop ebx
  363. ret 10h
  364. }
  365. /* *INDENT-ON* */
  366. }
  367. void __declspec(naked) _aullrem()
  368. {
  369. /* *INDENT-OFF* */
  370. __asm {
  371. push ebx
  372. mov eax,dword ptr [esp+14h]
  373. or eax,eax
  374. jne L1
  375. mov ecx,dword ptr [esp+10h]
  376. mov eax,dword ptr [esp+0Ch]
  377. xor edx,edx
  378. div ecx
  379. mov eax,dword ptr [esp+8]
  380. div ecx
  381. mov eax,edx
  382. xor edx,edx
  383. jmp L2
  384. L1:
  385. mov ecx,eax
  386. mov ebx,dword ptr [esp+10h]
  387. mov edx,dword ptr [esp+0Ch]
  388. mov eax,dword ptr [esp+8]
  389. L3:
  390. shr ecx,1
  391. rcr ebx,1
  392. shr edx,1
  393. rcr eax,1
  394. or ecx,ecx
  395. jne L3
  396. div ebx
  397. mov ecx,eax
  398. mul dword ptr [esp+14h]
  399. xchg eax,ecx
  400. mul dword ptr [esp+10h]
  401. add edx,ecx
  402. jb L4
  403. cmp edx,dword ptr [esp+0Ch]
  404. ja L4
  405. jb L5
  406. cmp eax,dword ptr [esp+8]
  407. jbe L5
  408. L4:
  409. sub eax,dword ptr [esp+10h]
  410. sbb edx,dword ptr [esp+14h]
  411. L5:
  412. sub eax,dword ptr [esp+8]
  413. sbb edx,dword ptr [esp+0Ch]
  414. neg edx
  415. neg eax
  416. sbb edx,0
  417. L2:
  418. pop ebx
  419. ret 10h
  420. }
  421. /* *INDENT-ON* */
  422. }
  423. void __declspec(naked) _alldvrm()
  424. {
  425. /* *INDENT-OFF* */
  426. __asm {
  427. push edi
  428. push esi
  429. push ebp
  430. xor edi,edi
  431. xor ebp,ebp
  432. mov eax,dword ptr [esp+14h]
  433. or eax,eax
  434. jge L1
  435. inc edi
  436. inc ebp
  437. mov edx,dword ptr [esp+10h]
  438. neg eax
  439. neg edx
  440. sbb eax,0
  441. mov dword ptr [esp+14h],eax
  442. mov dword ptr [esp+10h],edx
  443. L1:
  444. mov eax,dword ptr [esp+1Ch]
  445. or eax,eax
  446. jge L2
  447. inc edi
  448. mov edx,dword ptr [esp+18h]
  449. neg eax
  450. neg edx
  451. sbb eax,0
  452. mov dword ptr [esp+1Ch],eax
  453. mov dword ptr [esp+18h],edx
  454. L2:
  455. or eax,eax
  456. jne L3
  457. mov ecx,dword ptr [esp+18h]
  458. mov eax,dword ptr [esp+14h]
  459. xor edx,edx
  460. div ecx
  461. mov ebx,eax
  462. mov eax,dword ptr [esp+10h]
  463. div ecx
  464. mov esi,eax
  465. mov eax,ebx
  466. mul dword ptr [esp+18h]
  467. mov ecx,eax
  468. mov eax,esi
  469. mul dword ptr [esp+18h]
  470. add edx,ecx
  471. jmp L4
  472. L3:
  473. mov ebx,eax
  474. mov ecx,dword ptr [esp+18h]
  475. mov edx,dword ptr [esp+14h]
  476. mov eax,dword ptr [esp+10h]
  477. L5:
  478. shr ebx,1
  479. rcr ecx,1
  480. shr edx,1
  481. rcr eax,1
  482. or ebx,ebx
  483. jne L5
  484. div ecx
  485. mov esi,eax
  486. mul dword ptr [esp+1Ch]
  487. mov ecx,eax
  488. mov eax,dword ptr [esp+18h]
  489. mul esi
  490. add edx,ecx
  491. jb L6
  492. cmp edx,dword ptr [esp+14h]
  493. ja L6
  494. jb L7
  495. cmp eax,dword ptr [esp+10h]
  496. jbe L7
  497. L6:
  498. dec esi
  499. sub eax,dword ptr [esp+18h]
  500. sbb edx,dword ptr [esp+1Ch]
  501. L7:
  502. xor ebx,ebx
  503. L4:
  504. sub eax,dword ptr [esp+10h]
  505. sbb edx,dword ptr [esp+14h]
  506. dec ebp
  507. jns L9
  508. neg edx
  509. neg eax
  510. sbb edx,0
  511. L9:
  512. mov ecx,edx
  513. mov edx,ebx
  514. mov ebx,ecx
  515. mov ecx,eax
  516. mov eax,esi
  517. dec edi
  518. jne L8
  519. neg edx
  520. neg eax
  521. sbb edx,0
  522. L8:
  523. pop ebp
  524. pop esi
  525. pop edi
  526. ret 10h
  527. }
  528. /* *INDENT-ON* */
  529. }
  530. void __declspec(naked) _aulldvrm()
  531. {
  532. /* *INDENT-OFF* */
  533. __asm {
  534. push esi
  535. mov eax,dword ptr [esp+14h]
  536. or eax,eax
  537. jne L1
  538. mov ecx,dword ptr [esp+10h]
  539. mov eax,dword ptr [esp+0Ch]
  540. xor edx,edx
  541. div ecx
  542. mov ebx,eax
  543. mov eax,dword ptr [esp+8]
  544. div ecx
  545. mov esi,eax
  546. mov eax,ebx
  547. mul dword ptr [esp+10h]
  548. mov ecx,eax
  549. mov eax,esi
  550. mul dword ptr [esp+10h]
  551. add edx,ecx
  552. jmp L2
  553. L1:
  554. mov ecx,eax
  555. mov ebx,dword ptr [esp+10h]
  556. mov edx,dword ptr [esp+0Ch]
  557. mov eax,dword ptr [esp+8]
  558. L3:
  559. shr ecx,1
  560. rcr ebx,1
  561. shr edx,1
  562. rcr eax,1
  563. or ecx,ecx
  564. jne L3
  565. div ebx
  566. mov esi,eax
  567. mul dword ptr [esp+14h]
  568. mov ecx,eax
  569. mov eax,dword ptr [esp+10h]
  570. mul esi
  571. add edx,ecx
  572. jb L4
  573. cmp edx,dword ptr [esp+0Ch]
  574. ja L4
  575. jb L5
  576. cmp eax,dword ptr [esp+8]
  577. jbe L5
  578. L4:
  579. dec esi
  580. sub eax,dword ptr [esp+10h]
  581. sbb edx,dword ptr [esp+14h]
  582. L5:
  583. xor ebx,ebx
  584. L2:
  585. sub eax,dword ptr [esp+8]
  586. sbb edx,dword ptr [esp+0Ch]
  587. neg edx
  588. neg eax
  589. sbb edx,0
  590. mov ecx,edx
  591. mov edx,ebx
  592. mov ebx,ecx
  593. mov ecx,eax
  594. mov eax,esi
  595. pop esi
  596. ret 10h
  597. }
  598. /* *INDENT-ON* */
  599. }
  600. void __declspec(naked) _allshl()
  601. {
  602. /* *INDENT-OFF* */
  603. __asm {
  604. cmp cl,40h
  605. jae RETZERO
  606. cmp cl,20h
  607. jae MORE32
  608. shld edx,eax,cl
  609. shl eax,cl
  610. ret
  611. MORE32:
  612. mov edx,eax
  613. xor eax,eax
  614. and cl,1Fh
  615. shl edx,cl
  616. ret
  617. RETZERO:
  618. xor eax,eax
  619. xor edx,edx
  620. ret
  621. }
  622. /* *INDENT-ON* */
  623. }
  624. void __declspec(naked) _allshr()
  625. {
  626. /* *INDENT-OFF* */
  627. __asm {
  628. cmp cl,3Fh
  629. jae RETSIGN
  630. cmp cl,20h
  631. jae MORE32
  632. shrd eax,edx,cl
  633. sar edx,cl
  634. ret
  635. MORE32:
  636. mov eax,edx
  637. sar edx,1Fh
  638. and cl,1Fh
  639. sar eax,cl
  640. ret
  641. RETSIGN:
  642. sar edx,1Fh
  643. mov eax,edx
  644. ret
  645. }
  646. /* *INDENT-ON* */
  647. }
  648. void __declspec(naked) _aullshr()
  649. {
  650. /* *INDENT-OFF* */
  651. __asm {
  652. cmp cl,40h
  653. jae RETZERO
  654. cmp cl,20h
  655. jae MORE32
  656. shrd eax,edx,cl
  657. shr edx,cl
  658. ret
  659. MORE32:
  660. mov eax,edx
  661. xor edx,edx
  662. and cl,1Fh
  663. shr eax,cl
  664. ret
  665. RETZERO:
  666. xor eax,eax
  667. xor edx,edx
  668. ret
  669. }
  670. /* *INDENT-ON* */
  671. }
  672. void __declspec(naked) _chkstk(void)
  673. {
  674. __asm {
  675. push ecx
  676. mov ecx,esp ; lea ecx,dword ptr [esp]+4
  677. add ecx,4
  678. sub ecx,eax
  679. sbb eax,eax
  680. not eax
  681. and ecx,eax
  682. mov eax,esp
  683. and eax,0xfffff000
  684. L1:
  685. cmp ecx,eax
  686. jb short L2
  687. mov eax,ecx
  688. pop ecx
  689. xchg esp,eax
  690. mov eax,dword ptr [eax]
  691. mov dword ptr [esp],eax
  692. ret
  693. L2:
  694. sub eax,0x1000
  695. test dword ptr [eax],eax
  696. jmp short L1
  697. }
  698. }
  699. void __declspec(naked) _alloca_probe_8(void)
  700. {
  701. /* *INDENT-OFF* */
  702. __asm {
  703. push ecx
  704. mov ecx,esp ; lea ecx,dword ptr [esp]+8
  705. add ecx,8
  706. sub ecx,eax
  707. and ecx,0x7
  708. add eax,ecx
  709. sbb ecx,ecx
  710. or eax,ecx
  711. pop ecx
  712. jmp _chkstk
  713. }
  714. /* *INDENT-ON* */
  715. }
  716. void __declspec(naked) _alloca_probe_16(void)
  717. {
  718. /* *INDENT-OFF* */
  719. __asm {
  720. push ecx
  721. mov ecx,esp ; lea ecx,dword ptr [esp]+8
  722. add ecx,8
  723. sub ecx,eax
  724. and ecx,0xf
  725. add eax,ecx
  726. sbb ecx,ecx
  727. or eax,ecx
  728. pop ecx
  729. jmp _chkstk
  730. }
  731. /* *INDENT-ON* */
  732. }
  733. #endif /* _M_IX86 */
  734. #ifdef _M_ARM64
  735. void __chkstk(void);
  736. void __chkstk() {
  737. }
  738. #endif
  739. #endif /* MSC_VER */
  740. #ifdef __ICL
  741. /* The classic Intel compiler generates calls to _intel_fast_memcpy
  742. * and _intel_fast_memset when building an optimized SDL library */
  743. void *_intel_fast_memcpy(void *dst, const void *src, size_t len)
  744. {
  745. return SDL_memcpy(dst, src, len);
  746. }
  747. void *_intel_fast_memset(void *dst, int c, size_t len)
  748. {
  749. return SDL_memset(dst, c, len);
  750. }
  751. #endif
  752. #endif /* !HAVE_LIBC && !SDL_STATIC_LIB */