Arduino.h and wiring_digital.c problem.

Yes, I also had see that on Arduino.h, but the problem now is on the portOutputRegister and portInputRegister, since I can't use what it returns if this is correct.

I have this definition as a test sketch:

#define sbi(reg, bitmask) reg = 0xffffffff & bitmask

and the folowing vars:

volatile RwReg P_LED;
uint32_t B_LED;
P_LED = portOutputRegister(digitalPinToPort(13));
B_LED = digitalPinToBitMask(13);

using this test sketch to light the led on the pin 13 is not working:

sbi(P_LED,B_LED);
delay(1000);
cbi(P_LED,B_LED);
delay(1000);

Only if I go directly like this it works:

portOutputRegister(digitalPinToPort(13)) = 0xffffffff & digitalPinToBitMask(13);
delay(1000);
portOutputRegister(digitalPinToPort(13)) = 0x0 & digitalPinToBitMask(13);
delay(1000);

Looks like thar reg on sbi or cbi is not passed correct, any help, coments on this?

What sort of var should I declared so it works?