#macro make_arg1(op, a1)
{
  Generics wlist;
  chain_init(wlist, op);
  chain_add(wlist, a1);
#endmacro

#macro make_dep1(a1)
  chain_dep(a1, wlist);
}
#endmacro

#macro make_arg2(op, a1, a2)
{
  Generics wlist;
  chain_init(wlist, op);
  chain_add(wlist, a1);
  chain_add(wlist, a2);
#endmacro

#macro make_dep2(a1, a2)
  chain_dep(a1, wlist);
  chain_dep(a2, wlist);
}
#endmacro

#macro make_arg3(op, a1, a2, a3)
{
  Generics wlist;
  chain_init(wlist, op);
  chain_add(wlist, a1);
  chain_add(wlist, a2);
  chain_add(wlist, a3);
#endmacro

#macro make_dep3(a1, a2, a3)
  chain_dep(a1, wlist);
  chain_dep(a2, wlist);
  chain_dep(a3, wlist);
}
#endmacro

#macro make_arg4(op, a1, a2, a3, a4)
{
  Generics wlist;
  chain_init(wlist, op);
  chain_add(wlist, a1);
  chain_add(wlist, a2);
  chain_add(wlist, a3);
  chain_add(wlist, a4);
#endmacro

#macro make_dep4(a1, a2, a3, a4)
  chain_dep(a1, wlist);
  chain_dep(a2, wlist);
  chain_dep(a3, wlist);
  chain_dep(a4, wlist);
}
#endmacro

#macro make_arg5(op, a1, a2, a3, a4, a5)
{
  Generics wlist;
  chain_init(wlist, op);
  chain_add(wlist, a1);
  chain_add(wlist, a2);
  chain_add(wlist, a3);
  chain_add(wlist, a4);
  chain_add(wlist, a5);
#endmacro

#macro make_dep5(a1, a2, a3, a4, a5)
  chain_dep(a1, wlist);
  chain_dep(a2, wlist);
  chain_dep(a3, wlist);
  chain_dep(a4, wlist);
  chain_dep(a5, wlist);
}
#endmacro

#macro make_arg6(op, a1, a2, a3, a4, a5, a6)
{
  Generics wlist;
  chain_init(wlist, op);
  chain_add(wlist, a1);
  chain_add(wlist, a2);
  chain_add(wlist, a3);
  chain_add(wlist, a4);
  chain_add(wlist, a5);
  chain_add(wlist, a6);
#endmacro

#macro make_dep6(a1, a2, a3, a4, a5, a6)
  chain_dep(a1, wlist);
  chain_dep(a2, wlist);
  chain_dep(a3, wlist);
  chain_dep(a4, wlist);
  chain_dep(a5, wlist);
  chain_dep(a6, wlist);
}
#endmacro

#macro make_arg7(op, a1, a2, a3, a4, a5, a6, a7)
{
  Generics wlist;
  chain_init(wlist, op);
  chain_add(wlist, a1);
  chain_add(wlist, a2);
  chain_add(wlist, a3);
  chain_add(wlist, a4);
  chain_add(wlist, a5);
  chain_add(wlist, a6);
  chain_add(wlist, a7);
#endmacro

#macro make_dep7(a1, a2, a3, a4, a5, a6, a7)
  chain_dep(a1, wlist);
  chain_dep(a2, wlist);
  chain_dep(a3, wlist);
  chain_dep(a4, wlist);
  chain_dep(a5, wlist);
  chain_dep(a6, wlist);
  chain_dep(a7, wlist);
}
#endmacro

#macro make_arg8(op, a1, a2, a3, a4, a5, a6, a7, a8)
{
  Generics wlist;
  chain_init(wlist, op);
  chain_add(wlist, a1);
  chain_add(wlist, a2);
  chain_add(wlist, a3);
  chain_add(wlist, a4);
  chain_add(wlist, a5);
  chain_add(wlist, a6);
  chain_add(wlist, a7);
  chain_add(wlist, a8);
#endmacro

#macro make_dep8(a1, a2, a3, a4, a5, a6, a7, a8)
  chain_dep(a1, wlist);
  chain_dep(a2, wlist);
  chain_dep(a3, wlist);
  chain_dep(a4, wlist);
  chain_dep(a5, wlist);
  chain_dep(a6, wlist);
  chain_dep(a7, wlist);
  chain_dep(a8, wlist);
}
#endmacro

#macro make_arg9(op, a1, a2, a3, a4, a5, a6, a7, a8, a9)
{
  Generics wlist;
  chain_init(wlist, op);
  chain_add(wlist, a1);
  chain_add(wlist, a2);
  chain_add(wlist, a3);
  chain_add(wlist, a4);
  chain_add(wlist, a5);
  chain_add(wlist, a6);
  chain_add(wlist, a7);
  chain_add(wlist, a8);
  chain_add(wlist, a9);
#endmacro

#macro make_dep9(a1, a2, a3, a4, a5, a6, a7, a8, a9)
  chain_dep(a1, wlist);
  chain_dep(a2, wlist);
  chain_dep(a3, wlist);
  chain_dep(a4, wlist);
  chain_dep(a5, wlist);
  chain_dep(a6, wlist);
  chain_dep(a7, wlist);
  chain_dep(a8, wlist);
  chain_dep(a9, wlist);
}
#endmacro

#ifdef __STDC__
#macro make_anop(opc, argops, argc, args)
make_arg##argc args make_dep##opc argops
#endmacro
#else
#macro make_anop(opc, argops, argc, args)
make_arg/**/argc args make_dep/**/opc argops
#endmacro
#endif

#macro make_binop(op, c, a, b) make_anop(2, (a, b), 3, (op, c, a, b))
#endmacro
