hello everybody!
I am trying to understand some code of linux but i am not 100% able to understand preprocessor's directives and programming conventions...
here is the code i want to understand:
I can understand almost everything besides the 1st #define (all the rest are substitutions of symbols, isn't it?):Code:#define __define_initcall(level,fn,id) \ static initcall_t __initcall_##fn##id __attribute_used__ \ __attribute__((__section__(".initcall" level ".init"))) = fn #define device_initcall(fn) __define_initcall("6",fn,6) #define __initcall(fn) device_initcall(fn) #define module_init(x) __initcall(x);
the symbolwill be replaced withCode:__define_initcall(level,fn,id)the ##fn## has to be replaced with fn and the symbols at the left and right have to be concatenated, eg:Code:static initcall_t __initcall_##fn##id __attribute_used__ __attribute__((__section__(".initcall" level ".init"))) = fnwill becomeCode:__define_initcall("6",fn,6)is this a correct interpretation? what is the convention behing the double underscore (__) before the name of the macro?Code:static initcall_t __initcall_fnid __attribute_used__ __attribute__((__section__(".initcall" level ".init"))) = fn
thanks for your help! Bye



.