Avoiding #ifdefs

CoDeBrEaKeR <[email protected]>
Newsgroups gmane.linux.ports.arm.general
Message-ID <[email protected]>
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",
#ifdef SOME_ARCH_TYPE
	.bla                    = DO_THIS,
#else
	.bla                    = DO_SOMETHING_ELSE,
#endif
};

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

Thanks.

~A
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.