From: Jim Meyering Date: Tue, 29 Apr 2008 13:20:46 +0000 (+0000) Subject: Avoid in-function #if directives. X-Git-Tag: LIBVIRT_0_4_4~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe394e0baab11f80a5e432784ed52e8542869413;p=thirdparty%2Flibvirt.git Avoid in-function #if directives. * src/parthelper.c [!PED_PARTITION_PROTECTED]: Define to 0. Remove in-function #ifdefs. --- diff --git a/ChangeLog b/ChangeLog index ec4cd95dbf..8be63b814c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Apr 29 15:20:12 CEST 2008 Jim Meyering + + Avoid in-function #if directives. + * src/parthelper.c [!PED_PARTITION_PROTECTED]: Define to 0. + Remove in-function #ifdefs. + Tue Apr 29 09:15:00 BST 2008 Richard W.M. Jones * src/parthelper.c: Don't fail if PED_PARTITION_PROTECTED diff --git a/src/parthelper.c b/src/parthelper.c index a0fe241639..1cd72402d3 100644 --- a/src/parthelper.c +++ b/src/parthelper.c @@ -35,6 +35,12 @@ #include #include +/* Make the comparisons below fail if your parted headers + are so old that they lack the definition. */ +#ifndef PED_PARTITION_PROTECTED +# define PED_PARTITION_PROTECTED 0 +#endif + int main(int argc, char **argv) { PedDevice *dev; @@ -67,10 +73,8 @@ int main(int argc, char **argv) content = "free"; else if (part->type & PED_PARTITION_METADATA) content = "metadata"; -#ifdef PED_PARTITION_PROTECTED else if (part->type & PED_PARTITION_PROTECTED) content = "protected"; -#endif else content = "data"; } else if (part->type == PED_PARTITION_EXTENDED) { @@ -82,10 +86,8 @@ int main(int argc, char **argv) content = "free"; else if (part->type & PED_PARTITION_METADATA) content = "metadata"; -#ifdef PED_PARTITION_PROTECTED else if (part->type & PED_PARTITION_PROTECTED) content = "protected"; -#endif else content = "data"; }