#include <cstdio>
using std::printf;

#define XSTR(s) STR(s)
#define STR(s) #s
#define ARGDECL int i
#define BAR bar
#define INT int

aspect Calls {
  advice call ("% _foo(...)") : before () {
    printf ("before foo() call -> ");
  }
  advice execution ("% " XSTR(BAR) "(...)") : before () {
    printf ("before bar() execution -> ");
  }
};

#define VOID void

#define FOODEF \
VOID _foo (int, float) { \
  printf ("in foo()\n"); \
}

FOODEF

VOID BAR (INT i) {
  printf ("in bar()\n"); \
}

#define ARG 3+3

#define foo _foo

int main () {
  printf ("MacroCall:\n");
  printf ("=============================================================\n");
  printf ("call to foo() -> ");
  foo (ARG,ARG);
  printf ("call to bar() -> ");
  bar (ARG);
  printf ("=============================================================\n");
  return 0;
}
