Changeset 5 for pjproject/main/pjlib/src/pj/os_core_win32.c
- Timestamp:
- Nov 1, 2005 9:46:17 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/main/pjlib/src/pj/os_core_win32.c
r4 r5 496 496 * pj_atomic_set() 497 497 */ 498 PJ_DEF(long) pj_atomic_set(pj_atomic_t *atomic_var, long value) 498 PJ_DEF(void) pj_atomic_set( pj_atomic_t *atomic_var, pj_atomic_value_t value) 499 { 500 PJ_CHECK_STACK(); 501 502 InterlockedExchange(&atomic_var->value, value); 503 } 504 505 /* 506 * pj_atomic_get() 507 */ 508 PJ_DEF(pj_atomic_value_t) pj_atomic_get(pj_atomic_t *atomic_var) 499 509 { 500 510 PJ_CHECK_STACK(); 501 511 PJ_ASSERT_RETURN(atomic_var, 0); 502 512 503 return InterlockedExchange(&atomic_var->value, value);504 }505 506 /*507 * pj_atomic_get()508 */509 PJ_DEF(long) pj_atomic_get(pj_atomic_t *atomic_var)510 {511 PJ_CHECK_STACK();512 PJ_ASSERT_RETURN(atomic_var, 0);513 514 513 return atomic_var->value; 515 514 } … … 518 517 * pj_atomic_inc() 519 518 */ 520 PJ_DEF(long) pj_atomic_inc(pj_atomic_t *atomic_var) 521 { 522 PJ_CHECK_STACK(); 523 PJ_ASSERT_RETURN(atomic_var, 0); 519 PJ_DEF(void) pj_atomic_inc(pj_atomic_t *atomic_var) 520 { 521 PJ_CHECK_STACK(); 524 522 525 523 #if defined(PJ_WIN32_WINNT) && PJ_WIN32_WINNT >= 0x0400 526 returnInterlockedIncrement(&atomic_var->value);524 InterlockedIncrement(&atomic_var->value); 527 525 #else 528 526 # error Fix Me … … 533 531 * pj_atomic_dec() 534 532 */ 535 PJ_DEF(long) pj_atomic_dec(pj_atomic_t *atomic_var) 536 { 537 PJ_CHECK_STACK(); 538 PJ_ASSERT_RETURN(atomic_var, 0); 533 PJ_DEF(void) pj_atomic_dec(pj_atomic_t *atomic_var) 534 { 535 PJ_CHECK_STACK(); 539 536 540 537 #if defined(PJ_WIN32_WINNT) && PJ_WIN32_WINNT >= 0x0400 541 returnInterlockedDecrement(&atomic_var->value);538 InterlockedDecrement(&atomic_var->value); 542 539 #else 543 540 # error Fix me … … 545 542 } 546 543 547 544 /* 545 * pj_atomic_add() 546 */ 547 PJ_DEF(void) pj_atomic_add( pj_atomic_t *atomic_var, 548 pj_atomic_value_t value ) 549 { 550 InterlockedExchangeAdd( &atomic_var->value, value ); 551 } 552 553 548 554 /////////////////////////////////////////////////////////////////////////////// 549 555 /*
Note: See TracChangeset
for help on using the changeset viewer.