Better HN
topnewbestaskshowjobs
Log inSign up

troukistan

1 karma · joined Apr 15, 2020 (6y ago) · 1 submissions

Submissions

comment 6y ago · link · parent

Is there a way to append/extend a MACRO value ?

For example, I have a arbitrary number of includes, each of them declare a struct that need to be listed later on.

  #define MOD_LIST // start with an empty list

  #include "mod/a.c"
  // MOD_LIST is: a,

  #include "mod/b.c"
  // MOD_LIST is: a,b,
  
  Module modules[] = {
    MOD_LIST
  }