Something like that? :
#define W \
{\
for(pos = 0; pos < 180; pos += 1)\
{\
myservowrite(pos);\
delay(15);\
}\
for(pos = 180; pos>=1; pos-=1)\
{\
myservowrite(pos);\
delay(15);\
}\
}
//With parameters it's a little harder, you have to create new variables and copy the parameters into it, in order to work with them. Example:
#define PrintIntPlus2(value) \
{\
int v = value;\
v += 2;\
printf("%d", v);\
}
void setup()
{
W;
PrintIntPlus2(10);
}
But I agree it's bad practice, but sometimes very useful to create "functions" that are very hard to write the normal way.