Avoiding #ifdefs

CoDeBrEaKeR codebreaker28 at yahoo.com
Wed Jan 6 01:04:37 EST 2010

Most of the times its is easy to start having a lot of #ifdef statements in your code. Since this is not a proper thing to do, placing the #ifdef in a header file would be the usual suggestion. well, i understand this as far as #ifdefs in functions are concerned. How about structures?

for Ex:

 static struct something = {
	.name                   = "xyz",
	.driver_name            = "something",
	.bla                    = DO_THIS,
	.bla                    = DO_SOMETHING_ELSE,

How do i avoid #ifdef here, any idea??




More information about the linux-arm mailing list