Format
#include <builtin.h>int __inc4(int *pNum)
Language Level: None
__inc4 increments a signed integer in memory at address pNum.
This operation is only atomic on uni-processor machines.
Return Value
The return value indicates whether the incremented value
is negative, zero, or positive by returning -1, 0, or 1
respectively.
Example
This example increments the value of mem.
#include <stdio.h> #include <builtin.h>
int mem = -1;
int main(void)
{
if (!__inc4(&mem))
{
printf("The memory location is now zero.");
}
/*****************************************
The output should be:
The memory location is now zero. *****************************************/
return 0; }
![]()
__dec4 --
Decrement 4 Byte Signed Integer
__smp_dec4 --
Decrement 4 Byte Signed Integer Atomically
__smp_inc4 --
Increment 4 Byte Signed Integer Atomically