|
From: | Grégoire Sutre |
Subject: | Re: Build error: "ENABLE_NLS" is not defined |
Date: | Wed, 13 Jan 2010 02:02:22 +0100 |
User-agent: | Mozilla-Thunderbird 2.0.0.22 (X11/20090707) |
address@hidden wrote:
Another option would be to replace #if ENABLE_NLS by #if defined(ENABLE_NLS) && ENABLE_NLS.I know the C compiler short-circuits &&, if the preprocessor does also then this looks like the best solution. If not, then nested #if.
Yes the preprocessor also short-circuits (I tested a small example to be sure, with gcc 4.1 and gcc 4.4). So the automatic replacement command becomes:
find . -name '*.[ch]' -exec sed -i -e 's, ENABLE_NLS, (defined(ENABLE_NLS) \&\& ENABLE_NLS),g' '{}' ';'
Grégoirep.s. By the way, this kind of contruct appears in the autoconf manual for a similar problem (middle of page):
http://www.gnu.org/software/autoconf/manual/html_node/Generic-Declarations.html#Generic-Declarations
[Prev in Thread] | Current Thread | [Next in Thread] |