Auto-Format destroys multiline macros

In my code I'm defining some macros.
e.g.

#define calcNP() \
if ((this->state & 0xF0) == 0) { \
	if (myStack.index == stackSize) { \
      this->msNullpoint = getMsValue(); \
      this->nullpoint = mMapMsValue(this->msNullpoint); \
	  this->state = this->state | 0xF0; \
        } \
  }

If i try to format this file i get

#define calcNP() \
if ((this->state & 0xF0) == 0) { 
  \
	if (myStack.index == stackSize) { 
    \
      this->msNullpoint = getMsValue();  
    \
      this->nullpoint = mMapMsValue(this->msNullpoint); 
    \
	  this->state = this->state | 0xF0; 
    \
        } 
  \
  }

which now throws compile errors.

How can i prevent the formatter to format some code parts?
In Eclipse i can do this by adding

// @formatter:off
...
// @formatter:on

I strongly advise you against using macros where a function seems more appropriate. The compiler will probably inline it for you anyway. And it is more readable, and doesn't have this issue with the formatter.

Why are you even using this-> ? You don't normally need to do that.

No, the preprocessor will simply change the call to calcNP() with the desired macro code. If a use a methode calcNP() the compiler generates subroutine calls. (You can see this in the resulting code size. Using the marco, the code is slightly bigger.) I need this methode in a ISR, so i want to save as much clock cycles as i can.

The -> Operator is just for my readings...

You could try asking the compiler to inline it for you.

How?

Perhaps if you show all your code.

No problem, 8)
this is all the code (i'm just working on it...)
https://www.dropbox.com/sh/f1htvpkaovng5cf/LDc49Gvy-b

it's a complete Sketchbook with the test project. The original project (http://wkla.dyndns.org/ArduinoWiki/doku.php?id=arduino:modellbau:projekte:flugesc) is not ready... i just working on a new Servo/RCReciver lib for the ATTinyx5, because the one that i use, always let my servos jitter. :smiley:
(I use the latest WinAVR version, because i get the all known "R_AVR_13_PCREL against symbol" error)

I see. Well to answer your original question, all I can suggest you do is put the macros into a .h file and then don't auto-format that file.

Ok,
than i will put the macro in the .h file.
Is it worthwhile opening an issue for that?

Yes it probably is.