I am currently looking through the code of a "third-party" driver in an attempt to figure out/learn how it functions. I've had a look at sites such as this one, so I sort of understand how the basic premise works, but I don't understand the purpose of #ifdef MODULE
here. Google isn't really much help, but I think the definition refers to a kernel module? (I am also completely new to this.)
module_init(os_driver_init);
#ifdef MODULE
module_exit(os_driver_cleanup);
#endif
My question is, what happens if I remove the #ifdef
statement? Also, why/when would it be necessary to include the #ifdef
statement?