Strange error using the directive #define and #ifdef

Hi

I have and strange error when I use the directive #define and #ifdef, because if I try to compile the next code, this it doesn't compile and shows multiples mistakes, but if the directive #define is uncomment, this code compiles fine.

//#define DEBUGMEM

#ifdef DEBUGMEM
  uint8_t  _VARINI_;
#endif
int led = 13;

void setup() {                
  pinMode(led, OUTPUT);     
}

void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

What's wrong?? . . . It is assumed that all inside of the directive #ifdef is ignored if this is not met?

Thanks

PD: The code of blink is only used how example, this is not the real code that I am working

@trecetp

This is arduino preprocessor related,

There's a trick just move "int led = 13;" all the way to the top just under your #define Now it compiles with #define en //#define

I thought they would have fixed this already