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
  • 81,915
  • 7
  • 76
  • 137
NoahR
  • 1,347
  • 3
  • 16
  • 30

0 Answers0