]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Avoid in-function #if directives.
authorJim Meyering <meyering@redhat.com>
Tue, 29 Apr 2008 13:20:46 +0000 (13:20 +0000)
committerJim Meyering <meyering@redhat.com>
Tue, 29 Apr 2008 13:20:46 +0000 (13:20 +0000)
* src/parthelper.c [!PED_PARTITION_PROTECTED]: Define to 0.
Remove in-function #ifdefs.

ChangeLog
src/parthelper.c

index ec4cd95dbfdc0642b73ba6241dc90a46197978c9..8be63b814c49e92f1da30a7088562785253876df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Apr 29 15:20:12 CEST 2008 Jim Meyering <meyering@redhat.com>
+
+       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 <rjones@redhat.com>
 
        * src/parthelper.c: Don't fail if PED_PARTITION_PROTECTED
index a0fe2416391cf1f016e262e04e225ead0cd8bae6..1cd72402d35dd06d7428dc007fe19a8daa360c80 100644 (file)
 #include <parted/parted.h>
 #include <stdio.h>
 
+/* 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";
         }