1
> cat | cpp -c
#define ORDER 3
#define APPEND_ORDER(name) name ## _ ## ORDER

void APPEND_ORDER(cg)(int arg)
{}
^D

I see that the macro ORDER is not being expanded during the parameter replacement. But that's what I want!

# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "<stdin>"



void cg_ORDER(int arg)
{}

Desired output:

void cg_3(int arg)
{}
melpomene
  • 84,125
  • 8
  • 85
  • 148
NoahR
  • 1,417
  • 3
  • 18
  • 33

0 Answers0