comparison src/atomic/linux/SDL_atomic.c @ 3212:759032c318d8

This is a cosmetic fix, I found a stupid typo
author Bob Pendleton <bob@pendleton.com>
date Thu, 02 Jul 2009 21:47:02 +0000
parents 3aa519a5c676
children 48a80f2a7ff2
comparison
equal deleted inserted replaced
3211:8c7d86ae6509 3212:759032c318d8
140 SDL_AtomicExchange8(Uint8 * ptr, Uint8 value) 140 SDL_AtomicExchange8(Uint8 * ptr, Uint8 value)
141 { 141 {
142 #ifdef nativeExchange8 142 #ifdef nativeExchange8
143 return nativeExchange8(ptr, value); 143 return nativeExchange8(ptr, value);
144 #else 144 #else
145 Uint8 tmp = 0;; 145 Uint8 tmp = 0;
146 146
147 privateWaitLock(); 147 privateWaitLock();
148 tmp = *ptr; 148 tmp = *ptr;
149 *ptr = value; 149 *ptr = value;
150 privateUnlock(); 150 privateUnlock();
211 SDL_AtomicFetchThenIncrement8(Uint8 * ptr) 211 SDL_AtomicFetchThenIncrement8(Uint8 * ptr)
212 { 212 {
213 #ifdef nativeFetchThenIncrement8 213 #ifdef nativeFetchThenIncrement8
214 return nativeFetchThenIncrement8(ptr); 214 return nativeFetchThenIncrement8(ptr);
215 #else 215 #else
216 Uint8 tmp = 0;; 216 Uint8 tmp = 0;
217 217
218 privateWaitLock(); 218 privateWaitLock();
219 tmp = *ptr; 219 tmp = *ptr;
220 (*ptr)+= 1; 220 (*ptr)+= 1;
221 privateUnlock(); 221 privateUnlock();
228 SDL_AtomicFetchThenDecrement8(Uint8 * ptr) 228 SDL_AtomicFetchThenDecrement8(Uint8 * ptr)
229 { 229 {
230 #ifdef nativeFetchThenDecrement8 230 #ifdef nativeFetchThenDecrement8
231 return nativeFetchThenDecrement8(ptr); 231 return nativeFetchThenDecrement8(ptr);
232 #else 232 #else
233 Uint8 tmp = 0;; 233 Uint8 tmp = 0;
234 234
235 privateWaitLock(); 235 privateWaitLock();
236 tmp = *ptr; 236 tmp = *ptr;
237 (*ptr) -= 1; 237 (*ptr) -= 1;
238 privateUnlock(); 238 privateUnlock();
245 SDL_AtomicFetchThenAdd8(Uint8 * ptr, Uint8 value) 245 SDL_AtomicFetchThenAdd8(Uint8 * ptr, Uint8 value)
246 { 246 {
247 #ifdef nativeFetchThenAdd8 247 #ifdef nativeFetchThenAdd8
248 return nativeFetchThenAdd8(ptr, value); 248 return nativeFetchThenAdd8(ptr, value);
249 #else 249 #else
250 Uint8 tmp = 0;; 250 Uint8 tmp = 0;
251 251
252 privateWaitLock(); 252 privateWaitLock();
253 tmp = *ptr; 253 tmp = *ptr;
254 (*ptr)+= value; 254 (*ptr)+= value;
255 privateUnlock(); 255 privateUnlock();
262 SDL_AtomicFetchThenSubtract8(Uint8 * ptr, Uint8 value) 262 SDL_AtomicFetchThenSubtract8(Uint8 * ptr, Uint8 value)
263 { 263 {
264 #ifdef nativeFetchThenSubtract8 264 #ifdef nativeFetchThenSubtract8
265 return nativeFetchThenSubtract8(ptr, value); 265 return nativeFetchThenSubtract8(ptr, value);
266 #else 266 #else
267 Uint8 tmp = 0;; 267 Uint8 tmp = 0;
268 268
269 privateWaitLock(); 269 privateWaitLock();
270 tmp = *ptr; 270 tmp = *ptr;
271 (*ptr)-= value; 271 (*ptr)-= value;
272 privateUnlock(); 272 privateUnlock();
279 SDL_AtomicIncrementThenFetch8(Uint8 * ptr) 279 SDL_AtomicIncrementThenFetch8(Uint8 * ptr)
280 { 280 {
281 #ifdef nativeIncrementThenFetch8 281 #ifdef nativeIncrementThenFetch8
282 return nativeIncrementThenFetch8(ptr); 282 return nativeIncrementThenFetch8(ptr);
283 #else 283 #else
284 Uint8 tmp = 0;; 284 Uint8 tmp = 0;
285 285
286 privateWaitLock(); 286 privateWaitLock();
287 (*ptr)+= 1; 287 (*ptr)+= 1;
288 tmp = *ptr; 288 tmp = *ptr;
289 privateUnlock(); 289 privateUnlock();
296 SDL_AtomicDecrementThenFetch8(Uint8 * ptr) 296 SDL_AtomicDecrementThenFetch8(Uint8 * ptr)
297 { 297 {
298 #ifdef nativeDecrementThenFetch8 298 #ifdef nativeDecrementThenFetch8
299 return nativeDecrementThenFetch8(ptr); 299 return nativeDecrementThenFetch8(ptr);
300 #else 300 #else
301 Uint8 tmp = 0;; 301 Uint8 tmp = 0;
302 302
303 privateWaitLock(); 303 privateWaitLock();
304 (*ptr)-= 1; 304 (*ptr)-= 1;
305 tmp = *ptr; 305 tmp = *ptr;
306 privateUnlock(); 306 privateUnlock();
313 SDL_AtomicAddThenFetch8(Uint8 * ptr, Uint8 value) 313 SDL_AtomicAddThenFetch8(Uint8 * ptr, Uint8 value)
314 { 314 {
315 #ifdef nativeAddThenFetch8 315 #ifdef nativeAddThenFetch8
316 return nativeAddThenFetch8(ptr, value); 316 return nativeAddThenFetch8(ptr, value);
317 #else 317 #else
318 Uint8 tmp = 0;; 318 Uint8 tmp = 0;
319 319
320 privateWaitLock(); 320 privateWaitLock();
321 (*ptr)+= value; 321 (*ptr)+= value;
322 tmp = *ptr; 322 tmp = *ptr;
323 privateUnlock(); 323 privateUnlock();
330 SDL_AtomicSubtractThenFetch8(Uint8 * ptr, Uint8 value) 330 SDL_AtomicSubtractThenFetch8(Uint8 * ptr, Uint8 value)
331 { 331 {
332 #ifdef nativeSubtractThenFetch8 332 #ifdef nativeSubtractThenFetch8
333 return nativeSubtractThenFetch8(ptr, value); 333 return nativeSubtractThenFetch8(ptr, value);
334 #else 334 #else
335 Uint8 tmp = 0;; 335 Uint8 tmp = 0;
336 336
337 privateWaitLock(); 337 privateWaitLock();
338 (*ptr)-= value; 338 (*ptr)-= value;
339 tmp = *ptr; 339 tmp = *ptr;
340 privateUnlock(); 340 privateUnlock();
349 SDL_AtomicExchange16(Uint16 * ptr, Uint16 value) 349 SDL_AtomicExchange16(Uint16 * ptr, Uint16 value)
350 { 350 {
351 #ifdef nativeExchange16 351 #ifdef nativeExchange16
352 return nativeExchange16(ptr, value); 352 return nativeExchange16(ptr, value);
353 #else 353 #else
354 Uint16 tmp = 0;; 354 Uint16 tmp = 0;
355 355
356 privateWaitLock(); 356 privateWaitLock();
357 tmp = *ptr; 357 tmp = *ptr;
358 *ptr = value; 358 *ptr = value;
359 privateUnlock(); 359 privateUnlock();
420 SDL_AtomicFetchThenIncrement16(Uint16 * ptr) 420 SDL_AtomicFetchThenIncrement16(Uint16 * ptr)
421 { 421 {
422 #ifdef nativeFetchThenIncrement16 422 #ifdef nativeFetchThenIncrement16
423 return nativeFetchThenIncrement16(ptr); 423 return nativeFetchThenIncrement16(ptr);
424 #else 424 #else
425 Uint16 tmp = 0;; 425 Uint16 tmp = 0;
426 426
427 privateWaitLock(); 427 privateWaitLock();
428 tmp = *ptr; 428 tmp = *ptr;
429 (*ptr)+= 1; 429 (*ptr)+= 1;
430 privateUnlock(); 430 privateUnlock();
437 SDL_AtomicFetchThenDecrement16(Uint16 * ptr) 437 SDL_AtomicFetchThenDecrement16(Uint16 * ptr)
438 { 438 {
439 #ifdef nativeFetchThenDecrement16 439 #ifdef nativeFetchThenDecrement16
440 return nativeFetchThenDecrement16(ptr); 440 return nativeFetchThenDecrement16(ptr);
441 #else 441 #else
442 Uint16 tmp = 0;; 442 Uint16 tmp = 0;
443 443
444 privateWaitLock(); 444 privateWaitLock();
445 tmp = *ptr; 445 tmp = *ptr;
446 (*ptr) -= 1; 446 (*ptr) -= 1;
447 privateUnlock(); 447 privateUnlock();
454 SDL_AtomicFetchThenAdd16(Uint16 * ptr, Uint16 value) 454 SDL_AtomicFetchThenAdd16(Uint16 * ptr, Uint16 value)
455 { 455 {
456 #ifdef nativeFetchThenAdd16 456 #ifdef nativeFetchThenAdd16
457 return nativeFetchThenAdd16(ptr, value); 457 return nativeFetchThenAdd16(ptr, value);
458 #else 458 #else
459 Uint16 tmp = 0;; 459 Uint16 tmp = 0;
460 460
461 privateWaitLock(); 461 privateWaitLock();
462 tmp = *ptr; 462 tmp = *ptr;
463 (*ptr)+= value; 463 (*ptr)+= value;
464 privateUnlock(); 464 privateUnlock();
471 SDL_AtomicFetchThenSubtract16(Uint16 * ptr, Uint16 value) 471 SDL_AtomicFetchThenSubtract16(Uint16 * ptr, Uint16 value)
472 { 472 {
473 #ifdef nativeFetchThenSubtract16 473 #ifdef nativeFetchThenSubtract16
474 return nativeFetchThenSubtract16(ptr, value); 474 return nativeFetchThenSubtract16(ptr, value);
475 #else 475 #else
476 Uint16 tmp = 0;; 476 Uint16 tmp = 0;
477 477
478 privateWaitLock(); 478 privateWaitLock();
479 tmp = *ptr; 479 tmp = *ptr;
480 (*ptr)-= value; 480 (*ptr)-= value;
481 privateUnlock(); 481 privateUnlock();
488 SDL_AtomicIncrementThenFetch16(Uint16 * ptr) 488 SDL_AtomicIncrementThenFetch16(Uint16 * ptr)
489 { 489 {
490 #ifdef nativeIncrementThenFetch16 490 #ifdef nativeIncrementThenFetch16
491 return nativeIncrementThenFetch16(ptr); 491 return nativeIncrementThenFetch16(ptr);
492 #else 492 #else
493 Uint16 tmp = 0;; 493 Uint16 tmp = 0;
494 494
495 privateWaitLock(); 495 privateWaitLock();
496 (*ptr)+= 1; 496 (*ptr)+= 1;
497 tmp = *ptr; 497 tmp = *ptr;
498 privateUnlock(); 498 privateUnlock();
505 SDL_AtomicDecrementThenFetch16(Uint16 * ptr) 505 SDL_AtomicDecrementThenFetch16(Uint16 * ptr)
506 { 506 {
507 #ifdef nativeDecrementThenFetch16 507 #ifdef nativeDecrementThenFetch16
508 return nativeDecrementThenFetch16(ptr); 508 return nativeDecrementThenFetch16(ptr);
509 #else 509 #else
510 Uint16 tmp = 0;; 510 Uint16 tmp = 0;
511 511
512 privateWaitLock(); 512 privateWaitLock();
513 (*ptr)-= 1; 513 (*ptr)-= 1;
514 tmp = *ptr; 514 tmp = *ptr;
515 privateUnlock(); 515 privateUnlock();
522 SDL_AtomicAddThenFetch16(Uint16 * ptr, Uint16 value) 522 SDL_AtomicAddThenFetch16(Uint16 * ptr, Uint16 value)
523 { 523 {
524 #ifdef nativeAddThenFetch16 524 #ifdef nativeAddThenFetch16
525 return nativeAddThenFetch16(ptr, value); 525 return nativeAddThenFetch16(ptr, value);
526 #else 526 #else
527 Uint16 tmp = 0;; 527 Uint16 tmp = 0;
528 528
529 privateWaitLock(); 529 privateWaitLock();
530 (*ptr)+= value; 530 (*ptr)+= value;
531 tmp = *ptr; 531 tmp = *ptr;
532 privateUnlock(); 532 privateUnlock();
539 SDL_AtomicSubtractThenFetch16(Uint16 * ptr, Uint16 value) 539 SDL_AtomicSubtractThenFetch16(Uint16 * ptr, Uint16 value)
540 { 540 {
541 #ifdef nativeSubtractThenFetch16 541 #ifdef nativeSubtractThenFetch16
542 return nativeSubtractThenFetch16(ptr, value); 542 return nativeSubtractThenFetch16(ptr, value);
543 #else 543 #else
544 Uint16 tmp = 0;; 544 Uint16 tmp = 0;
545 545
546 privateWaitLock(); 546 privateWaitLock();
547 (*ptr)-= value; 547 (*ptr)-= value;
548 tmp = *ptr; 548 tmp = *ptr;
549 privateUnlock(); 549 privateUnlock();
558 SDL_AtomicExchange32(Uint32 * ptr, Uint32 value) 558 SDL_AtomicExchange32(Uint32 * ptr, Uint32 value)
559 { 559 {
560 #ifdef nativeExchange32 560 #ifdef nativeExchange32
561 return nativeExchange32(ptr, value); 561 return nativeExchange32(ptr, value);
562 #else 562 #else
563 Uint32 tmp = 0;; 563 Uint32 tmp = 0;
564 564
565 privateWaitLock(); 565 privateWaitLock();
566 tmp = *ptr; 566 tmp = *ptr;
567 *ptr = value; 567 *ptr = value;
568 privateUnlock(); 568 privateUnlock();
629 SDL_AtomicFetchThenIncrement32(Uint32 * ptr) 629 SDL_AtomicFetchThenIncrement32(Uint32 * ptr)
630 { 630 {
631 #ifdef nativeFetchThenIncrement32 631 #ifdef nativeFetchThenIncrement32
632 return nativeFetchThenIncrement32(ptr); 632 return nativeFetchThenIncrement32(ptr);
633 #else 633 #else
634 Uint32 tmp = 0;; 634 Uint32 tmp = 0;
635 635
636 privateWaitLock(); 636 privateWaitLock();
637 tmp = *ptr; 637 tmp = *ptr;
638 (*ptr)+= 1; 638 (*ptr)+= 1;
639 privateUnlock(); 639 privateUnlock();
646 SDL_AtomicFetchThenDecrement32(Uint32 * ptr) 646 SDL_AtomicFetchThenDecrement32(Uint32 * ptr)
647 { 647 {
648 #ifdef nativeFetchThenDecrement32 648 #ifdef nativeFetchThenDecrement32
649 return nativeFetchThenDecrement32(ptr); 649 return nativeFetchThenDecrement32(ptr);
650 #else 650 #else
651 Uint32 tmp = 0;; 651 Uint32 tmp = 0;
652 652
653 privateWaitLock(); 653 privateWaitLock();
654 tmp = *ptr; 654 tmp = *ptr;
655 (*ptr) -= 1; 655 (*ptr) -= 1;
656 privateUnlock(); 656 privateUnlock();
663 SDL_AtomicFetchThenAdd32(Uint32 * ptr, Uint32 value) 663 SDL_AtomicFetchThenAdd32(Uint32 * ptr, Uint32 value)
664 { 664 {
665 #ifdef nativeFetchThenAdd32 665 #ifdef nativeFetchThenAdd32
666 return nativeFetchThenAdd32(ptr, value); 666 return nativeFetchThenAdd32(ptr, value);
667 #else 667 #else
668 Uint32 tmp = 0;; 668 Uint32 tmp = 0;
669 669
670 privateWaitLock(); 670 privateWaitLock();
671 tmp = *ptr; 671 tmp = *ptr;
672 (*ptr)+= value; 672 (*ptr)+= value;
673 privateUnlock(); 673 privateUnlock();
680 SDL_AtomicFetchThenSubtract32(Uint32 * ptr, Uint32 value) 680 SDL_AtomicFetchThenSubtract32(Uint32 * ptr, Uint32 value)
681 { 681 {
682 #ifdef nativeFetchThenSubtract32 682 #ifdef nativeFetchThenSubtract32
683 return nativeFetchThenSubtract32(ptr, value); 683 return nativeFetchThenSubtract32(ptr, value);
684 #else 684 #else
685 Uint32 tmp = 0;; 685 Uint32 tmp = 0;
686 686
687 privateWaitLock(); 687 privateWaitLock();
688 tmp = *ptr; 688 tmp = *ptr;
689 (*ptr)-= value; 689 (*ptr)-= value;
690 privateUnlock(); 690 privateUnlock();
697 SDL_AtomicIncrementThenFetch32(Uint32 * ptr) 697 SDL_AtomicIncrementThenFetch32(Uint32 * ptr)
698 { 698 {
699 #ifdef nativeIncrementThenFetch32 699 #ifdef nativeIncrementThenFetch32
700 return nativeIncrementThenFetch32(ptr); 700 return nativeIncrementThenFetch32(ptr);
701 #else 701 #else
702 Uint32 tmp = 0;; 702 Uint32 tmp = 0;
703 703
704 privateWaitLock(); 704 privateWaitLock();
705 (*ptr)+= 1; 705 (*ptr)+= 1;
706 tmp = *ptr; 706 tmp = *ptr;
707 privateUnlock(); 707 privateUnlock();
714 SDL_AtomicDecrementThenFetch32(Uint32 * ptr) 714 SDL_AtomicDecrementThenFetch32(Uint32 * ptr)
715 { 715 {
716 #ifdef nativeDecrementThenFetch32 716 #ifdef nativeDecrementThenFetch32
717 return nativeDecrementThenFetch32(ptr); 717 return nativeDecrementThenFetch32(ptr);
718 #else 718 #else
719 Uint32 tmp = 0;; 719 Uint32 tmp = 0;
720 720
721 privateWaitLock(); 721 privateWaitLock();
722 (*ptr)-= 1; 722 (*ptr)-= 1;
723 tmp = *ptr; 723 tmp = *ptr;
724 privateUnlock(); 724 privateUnlock();
731 SDL_AtomicAddThenFetch32(Uint32 * ptr, Uint32 value) 731 SDL_AtomicAddThenFetch32(Uint32 * ptr, Uint32 value)
732 { 732 {
733 #ifdef nativeAddThenFetch32 733 #ifdef nativeAddThenFetch32
734 return nativeAddThenFetch32(ptr, value); 734 return nativeAddThenFetch32(ptr, value);
735 #else 735 #else
736 Uint32 tmp = 0;; 736 Uint32 tmp = 0;
737 737
738 privateWaitLock(); 738 privateWaitLock();
739 (*ptr)+= value; 739 (*ptr)+= value;
740 tmp = *ptr; 740 tmp = *ptr;
741 privateUnlock(); 741 privateUnlock();
748 SDL_AtomicSubtractThenFetch32(Uint32 * ptr, Uint32 value) 748 SDL_AtomicSubtractThenFetch32(Uint32 * ptr, Uint32 value)
749 { 749 {
750 #ifdef nativeSubtractThenFetch32 750 #ifdef nativeSubtractThenFetch32
751 return nativeSubtractThenFetch32(ptr, value); 751 return nativeSubtractThenFetch32(ptr, value);
752 #else 752 #else
753 Uint32 tmp = 0;; 753 Uint32 tmp = 0;
754 754
755 privateWaitLock(); 755 privateWaitLock();
756 (*ptr)-= value; 756 (*ptr)-= value;
757 tmp = *ptr; 757 tmp = *ptr;
758 privateUnlock(); 758 privateUnlock();
768 SDL_AtomicExchange64(Uint64 * ptr, Uint64 value) 768 SDL_AtomicExchange64(Uint64 * ptr, Uint64 value)
769 { 769 {
770 #ifdef nativeExchange64 770 #ifdef nativeExchange64
771 return nativeExchange64(ptr, value); 771 return nativeExchange64(ptr, value);
772 #else 772 #else
773 Uint64 tmp = 0;; 773 Uint64 tmp = 0;
774 774
775 privateWaitLock(); 775 privateWaitLock();
776 tmp = *ptr; 776 tmp = *ptr;
777 *ptr = value; 777 *ptr = value;
778 privateUnlock(); 778 privateUnlock();
839 SDL_AtomicFetchThenIncrement64(Uint64 * ptr) 839 SDL_AtomicFetchThenIncrement64(Uint64 * ptr)
840 { 840 {
841 #ifdef nativeFetchThenIncrement64 841 #ifdef nativeFetchThenIncrement64
842 return nativeFetchThenIncrement64(ptr); 842 return nativeFetchThenIncrement64(ptr);
843 #else 843 #else
844 Uint64 tmp = 0;; 844 Uint64 tmp = 0;
845 845
846 privateWaitLock(); 846 privateWaitLock();
847 tmp = *ptr; 847 tmp = *ptr;
848 (*ptr)+= 1; 848 (*ptr)+= 1;
849 privateUnlock(); 849 privateUnlock();
856 SDL_AtomicFetchThenDecrement64(Uint64 * ptr) 856 SDL_AtomicFetchThenDecrement64(Uint64 * ptr)
857 { 857 {
858 #ifdef nativeFetchThenDecrement64 858 #ifdef nativeFetchThenDecrement64
859 return nativeFetchThenDecrement64(ptr); 859 return nativeFetchThenDecrement64(ptr);
860 #else 860 #else
861 Uint64 tmp = 0;; 861 Uint64 tmp = 0;
862 862
863 privateWaitLock(); 863 privateWaitLock();
864 tmp = *ptr; 864 tmp = *ptr;
865 (*ptr) -= 1; 865 (*ptr) -= 1;
866 privateUnlock(); 866 privateUnlock();
873 SDL_AtomicFetchThenAdd64(Uint64 * ptr, Uint64 value) 873 SDL_AtomicFetchThenAdd64(Uint64 * ptr, Uint64 value)
874 { 874 {
875 #ifdef nativeFetchThenAdd64 875 #ifdef nativeFetchThenAdd64
876 return nativeFetchThenAdd64(ptr, value); 876 return nativeFetchThenAdd64(ptr, value);
877 #else 877 #else
878 Uint64 tmp = 0;; 878 Uint64 tmp = 0;
879 879
880 privateWaitLock(); 880 privateWaitLock();
881 tmp = *ptr; 881 tmp = *ptr;
882 (*ptr)+= value; 882 (*ptr)+= value;
883 privateUnlock(); 883 privateUnlock();
890 SDL_AtomicFetchThenSubtract64(Uint64 * ptr, Uint64 value) 890 SDL_AtomicFetchThenSubtract64(Uint64 * ptr, Uint64 value)
891 { 891 {
892 #ifdef nativeFetchThenSubtract64 892 #ifdef nativeFetchThenSubtract64
893 return nativeFetchThenSubtract64(ptr, value); 893 return nativeFetchThenSubtract64(ptr, value);
894 #else 894 #else
895 Uint64 tmp = 0;; 895 Uint64 tmp = 0;
896 896
897 privateWaitLock(); 897 privateWaitLock();
898 tmp = *ptr; 898 tmp = *ptr;
899 (*ptr)-= value; 899 (*ptr)-= value;
900 privateUnlock(); 900 privateUnlock();
907 SDL_AtomicIncrementThenFetch64(Uint64 * ptr) 907 SDL_AtomicIncrementThenFetch64(Uint64 * ptr)
908 { 908 {
909 #ifdef nativeIncrementThenFetch64 909 #ifdef nativeIncrementThenFetch64
910 return nativeIncrementThenFetch64(ptr); 910 return nativeIncrementThenFetch64(ptr);
911 #else 911 #else
912 Uint64 tmp = 0;; 912 Uint64 tmp = 0;
913 913
914 privateWaitLock(); 914 privateWaitLock();
915 (*ptr)+= 1; 915 (*ptr)+= 1;
916 tmp = *ptr; 916 tmp = *ptr;
917 privateUnlock(); 917 privateUnlock();
924 SDL_AtomicDecrementThenFetch64(Uint64 * ptr) 924 SDL_AtomicDecrementThenFetch64(Uint64 * ptr)
925 { 925 {
926 #ifdef nativeDecrementThenFetch64 926 #ifdef nativeDecrementThenFetch64
927 return nativeDecrementThenFetch64(ptr); 927 return nativeDecrementThenFetch64(ptr);
928 #else 928 #else
929 Uint64 tmp = 0;; 929 Uint64 tmp = 0;
930 930
931 privateWaitLock(); 931 privateWaitLock();
932 (*ptr)-= 1; 932 (*ptr)-= 1;
933 tmp = *ptr; 933 tmp = *ptr;
934 privateUnlock(); 934 privateUnlock();
941 SDL_AtomicAddThenFetch64(Uint64 * ptr, Uint64 value) 941 SDL_AtomicAddThenFetch64(Uint64 * ptr, Uint64 value)
942 { 942 {
943 #ifdef nativeAddThenFetch64 943 #ifdef nativeAddThenFetch64
944 return nativeAddThenFetch64(ptr, value); 944 return nativeAddThenFetch64(ptr, value);
945 #else 945 #else
946 Uint64 tmp = 0;; 946 Uint64 tmp = 0;
947 947
948 privateWaitLock(); 948 privateWaitLock();
949 (*ptr)+= value; 949 (*ptr)+= value;
950 tmp = *ptr; 950 tmp = *ptr;
951 privateUnlock(); 951 privateUnlock();
958 SDL_AtomicSubtractThenFetch64(Uint64 * ptr, Uint64 value) 958 SDL_AtomicSubtractThenFetch64(Uint64 * ptr, Uint64 value)
959 { 959 {
960 #ifdef nativeSubtractThenFetch64 960 #ifdef nativeSubtractThenFetch64
961 return nativeSubtractThenFetch64(ptr, value); 961 return nativeSubtractThenFetch64(ptr, value);
962 #else 962 #else
963 Uint64 tmp = 0;; 963 Uint64 tmp = 0;
964 964
965 privateWaitLock(); 965 privateWaitLock();
966 (*ptr)-= value; 966 (*ptr)-= value;
967 tmp = *ptr; 967 tmp = *ptr;
968 privateUnlock(); 968 privateUnlock();