|| ||Linus Torvalds <torvalds-AT-linux-foundation.org> |
|| ||Paul Gortmaker <paul.gortmaker-AT-windriver.com> |
|| ||Re: [PATCH 0/5] RFC: strip 15,000 lines from a typical autoconf.h |
|| ||Wed, 11 Apr 2012 18:19:58 -0700|
|| ||linux-kbuild-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org,
tony-AT-bakeyournoodle.com, mmarek-AT-suse.cz, lacombar-AT-gmail.com|
|| ||Article, Thread
On Wed, Apr 11, 2012 at 4:58 PM, Linus Torvalds
> I think we can easily drop IS_ENABLED() if it has been causing
> problems. And it clearly is.
> And I had never even looked at that generated file. It's disgusting.
> We need to stop doing that. It must be driving compile-times up too -
> just parsing that monster is RealWork(tm).
Oh, but I have a sick and twisted mind. And I'm incredibly smart and
Here's an implementation of IS_ENABLED() that works in C. Well,
"gcc-C". It depends on the optimizer DTRT, but gcc really does seem to
Ready? You *will* go blind - blinded by the pure beauty and intellect
in this thing:
#define IS_DEFINED(x) (__stringify(CONFIG_##x)=='1')
That really is a piece of art. I'm expecting that the Guggenheim will
contact me any moment now about it.
Of course, the above does *not* work for a pre-processor, but hey, you
can't have everything. It literally is *only* valid in C code. You
can't have everything. In the pre-processor, you can just use
like you always could, or use another helper macro for the "defined(x)" magic.
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to firstname.lastname@example.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
to post comments)