[libvirt] [PATCH] Workaround for broken GCC in Debian Etch

Hi again! I missed one patch for working around a GCC bug in Debian Etch regarding limit definitions. Sorry for the unstripped git-format-patch outputs, I just realised this after pressing send :( (This seems to be not my day :)) Ciao Max -- Gib Dein Bestes. Dann übertriff Dich selbst!

On Thu, Jul 30, 2009 at 09:29:20PM +0200, Maximilian Wilhelm wrote:
Hi again!
I missed one patch for working around a GCC bug in Debian Etch regarding limit definitions.
Sorry for the unstripped git-format-patch outputs, I just realised this after pressing send :(
(This seems to be not my day :))
Ciao Max -- Gib Dein Bestes. Dann übertriff Dich selbst!
* src/storage_backend_fs.c: Work around broken limits.h in Debian Etch.
--- src/storage_backend_fs.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c index ca6d329..599cf1a 100644 --- a/src/storage_backend_fs.c +++ b/src/storage_backend_fs.c @@ -44,6 +44,12 @@ #include "memory.h" #include "xml.h"
+/* Work around broken limits.h on debian etch */ +#if defined __GNUC__ && defined _GCC_LIMITS_H_ && ! defined ULLONG_MAX +# define ULLONG_MAX ULONG_LONG_MAX +#endif
Since it is 'internal.h' that pulls in limits.h, we should probably just put that logic in internal.h, so it is visible to all libvirt source files, and delete the duplicate in storage_conf.c Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Anno domini 2009 Daniel P. Berrange scripsit:
I missed one patch for working around a GCC bug in Debian Etch regarding limit definitions.
Sorry for the unstripped git-format-patch outputs, I just realised this after pressing send :(
(This seems to be not my day :))
Since it is 'internal.h' that pulls in limits.h, we should probably just put that logic in internal.h, so it is visible to all libvirt source files, and delete the duplicate in storage_conf.c
Here we go. Ciao Max -- "Ich habe eher spontan mitbestellt, ohne genau zu wissen, was ich da gerade kaufe. Immer noch besser, als Schuhe zu kaufen." -- uschebit zum Thema SheevaPlug

On Sun, Aug 02, 2009 at 05:36:20PM +0200, Maximilian Wilhelm wrote:
Anno domini 2009 Daniel P. Berrange scripsit:
I missed one patch for working around a GCC bug in Debian Etch regarding limit definitions.
Sorry for the unstripped git-format-patch outputs, I just realised this after pressing send :(
(This seems to be not my day :))
Since it is 'internal.h' that pulls in limits.h, we should probably just put that logic in internal.h, so it is visible to all libvirt source files, and delete the duplicate in storage_conf.c
Here we go.
ACK, looks good. Daniel
diff --git a/src/internal.h b/src/internal.h index cf7e196..936cd03 100644 --- a/src/internal.h +++ b/src/internal.h @@ -73,8 +73,14 @@ #else #define __GNUC_PREREQ(maj,min) 0 #endif + +/* Work around broken limits.h on debian etch */ +#if defined _GCC_LIMITS_H_ && ! defined ULLONG_MAX +#define ULLONG_MAX ULONG_LONG_MAX #endif
+#endif /* __GNUC__ */ + /** * ATTRIBUTE_UNUSED: * diff --git a/src/storage_conf.c b/src/storage_conf.c index 075279c..245b2d0 100644 --- a/src/storage_conf.c +++ b/src/storage_conf.c @@ -45,11 +45,6 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
-/* Work around broken limits.h on debian etch */ -#if defined __GNUC__ && defined _GCC_LIMITS_H_ && ! defined ULLONG_MAX -# define ULLONG_MAX ULONG_LONG_MAX -#endif - #define virStorageError(conn, code, fmt...) \ virReportErrorHelper(conn, VIR_FROM_STORAGE, code, __FILE__,\ __FUNCTION__, __LINE__, fmt)
-- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Sun, Aug 02, 2009 at 05:36:20PM +0200, Maximilian Wilhelm wrote:
Anno domini 2009 Daniel P. Berrange scripsit:
I missed one patch for working around a GCC bug in Debian Etch regarding limit definitions.
Sorry for the unstripped git-format-patch outputs, I just realised this after pressing send :(
(This seems to be not my day :))
Since it is 'internal.h' that pulls in limits.h, we should probably just put that logic in internal.h, so it is visible to all libvirt source files, and delete the duplicate in storage_conf.c
Here we go.
Looks fine, applied and commited, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Maximilian Wilhelm