From an open source kernel extension I was making some changes to:
// warning: egregious abuse of preprocessor follows!
#define private public
#define protected public
#include <IOKit/hidsystem/IOHIDSystem.h>
#undef private
#undef protected
I really just have no words...
Subscribe to:
Post Comments (Atom)
3 comments:
Will this even work?
What about private sections that don't use the private keyword?
class Rodarmor {
int isPrivate
}
Sorry Casey, just curious and being a jerk
First, I should just mention that I'm not the author of this excellent little snippet of code, I just stumbled onto it :-)
But yeah, you're right, if the keyword doesn't appear, then there's no way for the preprocessor to replace it.
in which case, depending on compiler, the author probably should've specified something like -fno-access-control
Post a Comment