c - How is this generic function is used -


i going through code write has been made register. made generic function write different register has go through same function:

   #define rgs(x) \      static inline void write_##x(u8 val) \      { \      }  #define regw(x) rgs(x)  write_wdc(val); 

now want know when call write_wdc made, how replaced these macros.

this doesn't show macro being used, in order final line (the call) work, there has like:

regw(wdc) 

somewhere in code, use macro. above replaced preprocessor with:

rgs(wdc) 

which in turn replaced with

static inline void write_wdc(u8 val) { } 

i assume body of function missing macro declaration too, expect x = val; in there make write happen.

this uses ## preprocessor operator "glue" words together.


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

tsql - Pivot with Temp Table (definition for column must include data type) -- SQL Server 2008 -