From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NlnY3-0001xO-9U for qemu-devel@nongnu.org; Sun, 28 Feb 2010 13:07:23 -0500 Received: from [199.232.76.173] (port=46774 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NlnY1-0001wy-5z for qemu-devel@nongnu.org; Sun, 28 Feb 2010 13:07:21 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NlnXz-00070I-Bj for qemu-devel@nongnu.org; Sun, 28 Feb 2010 13:07:20 -0500 Received: from hall.aurel32.net ([88.191.82.174]:49280) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NlnXy-000708-Vy for qemu-devel@nongnu.org; Sun, 28 Feb 2010 13:07:19 -0500 Date: Sun, 28 Feb 2010 19:07:13 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] Use of LONG_LONG_MAX breaks build on OSX ? Message-ID: <20100228180713.GO10291@volta.aurel32.net> References: <4B466C56.5020701@libera.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <4B466C56.5020701@libera.cc> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Emmanuel Kasper Cc: qemu-devel@nongnu.org On Fri, Jan 08, 2010 at 12:20:54AM +0100, Emmanuel Kasper wrote: > Hello > Qemu does not build on my platform ( OSX / 10.5 / PowerPC ) because of > the use of LONG_LONG_MAX in raw-posix.c > Replacing LONG_LONG_MAX with LLONG_MAX fixes the build and is more > standard IMHO ( LONG_LONG_MAX is GNU libc, LLONG_MAX is C99 standard ) > The following patch makes this trivial switch. As qemu is not compiled with -std=c99, LLONG_MAX is not guaranteed to be defined (it is on recent systems, not on old ones). The best solution in that case is probably to do at the begining of the file: #ifndef LONG_LONG_MAX #define LONG_LONG_MAX LLONG_MAX #endif Or applying your patch and doing the reverse. Also please add a Signed-off-by: line. > --- block-raw-posix.c.before 2010-01-07 22:40:37.000000000 +0100 > +++ block-raw-posix.c 2010-01-07 22:41:43.000000000 +0100 > @@ -782,7 +782,7 @@ > if (size == 0) > #endif > #ifdef CONFIG_COCOA > - size = LONG_LONG_MAX; > + size = LLONG_MAX; > #else > size = lseek(fd, 0LL, SEEK_END); > #endif > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net