0

I was looking at the source code of the berkeley lab checkpoint/restart and found this pre-process macro definition:

  #define io_wrap(_op,_ctx,_file,_buf,_count) \
        cr_##_op((_ctx)->req->errbuf,(_file),(_buf),(_count))

Any idea what the hell this thing means?

I found this in blcr-0.8.5/vmadump4/vmadump.h

Thank you!

feeling_lonely
  • 6,665
  • 4
  • 27
  • 53

2 Answers2

4

It's token concatenation. See the GCC manual: http://gcc.gnu.org/onlinedocs/cpp/Concatenation.html

And for some of its nitty gritty details, see this question: How to concatenate twice with the C preprocessor and expand a macro as in "arg ## _ ## MACRO"?

Community
  • 1
  • 1
Filipe Gonçalves
  • 20,783
  • 6
  • 53
  • 70
2

## is for concatenation in the C preprocessor.

This result _op((_ctx)->req->errbuf,(_file),(_buf),(_count)) is concatenated with cr_

Engineer2021
  • 3,288
  • 6
  • 29
  • 51