
nixpanic at users
Jul 21, 2008, 7:25 AM
Post #11 of 11
(1053 views)
Permalink
|
On Mon, Jul 21, 2008 at 12:27 PM, Paulo Cavalcanti <promac[at]gmail.com> wrote: > > > On Mon, Jul 21, 2008 at 6:52 AM, Niels de Vos > <nixpanic[at]users.sourceforge.net> wrote: >> >> On Sun, Jul 20, 2008 at 9:23 PM, Axel Thimm <Axel.Thimm[at]atrpms.net> wrote: >> > Hi, >> > >> > On Sun, Jul 20, 2008 at 05:38:05PM +0200, Niels de Vos wrote: >> >> Here it is, a patch against the current trunk (r232). Tested on >> >> 2.6.18-8.el5, 2.6.18-53.el5 and 2.6.18-92.1.6.el5.centos.plus. Seems >> >> that 2.6.18-8.el5 does not have any RHEL_*-macros. This patch makes the >> >> same check in 2-stages, fixing the use of an undefinde macro-function >> >> (RHEL_RELEASE_VERSION). It should be safe to use on any other distro >> >> too. >> > >> > thanks, that seems to work! >> > >> > But I honestly don't understand why. :) >> > >> > The same macros are being checked for existence and the "same" >> > conditions checked, what was the secret sauce? :) >> >> That's not complete clear to me either, heer is what I think... >> >> First there was: >> #if !defined(RHEL_RELEASE_CODE) || RHEL_RELEASE_CODE >= >> RHEL_RELEASE_VERSION(5,2) >> >> It seems that RHEL_RELEASE_VERSION() gets expanded, even if >> RHEL_RELEASE_CODE is not defined. >> Splitting the two checks like below, should not trigger the >> RHEL_RELEASE_VERSION() as it is completely skipped. >> >> For me it was some unexpected gcc/cpp behavior... >> > > > Remember that this code (#) is interpreted by the pre-compiler. > There is no way to guarantee how the tests are going to be evaluated. > It is really not advisable to use such a long construction, in this case. Okay, thanks for the info :) And as a side-note: this patch has just been included upstream (r233). Niels _______________________________________________ atrpms-devel mailing list atrpms-devel[at]atrpms.net http://lists.atrpms.net/mailman/listinfo/atrpms-devel
|