diff mbox

block/raw-posix.c: Avoid nonstandard LONG_LONG_MAX

Message ID 1400861741-16077-1-git-send-email-peter.maydell@linaro.org
State New
Headers show

Commit Message

Peter Maydell May 23, 2014, 4:15 p.m. UTC
In the MacOSX specific code in raw-posix.c we use the define
LONG_LONG_MAX. This is actually a non-standard pre-C99 define;
switch to using the standard LLONG_MAX instead.

This apparently fixes a compilation failure with certain
compiler/OS versions (though it is unclear which).

Reported-by: Peter Bartoli <peter@bartoli.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 block/raw-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Hajnoczi May 26, 2014, 11:58 a.m. UTC | #1
On Fri, May 23, 2014 at 05:15:41PM +0100, Peter Maydell wrote:
> In the MacOSX specific code in raw-posix.c we use the define
> LONG_LONG_MAX. This is actually a non-standard pre-C99 define;
> switch to using the standard LLONG_MAX instead.
> 
> This apparently fixes a compilation failure with certain
> compiler/OS versions (though it is unclear which).
> 
> Reported-by: Peter Bartoli <peter@bartoli.org>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  block/raw-posix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Kevin Wolf May 28, 2014, 12:51 p.m. UTC | #2
Am 26.05.2014 um 13:58 hat Stefan Hajnoczi geschrieben:
> On Fri, May 23, 2014 at 05:15:41PM +0100, Peter Maydell wrote:
> > In the MacOSX specific code in raw-posix.c we use the define
> > LONG_LONG_MAX. This is actually a non-standard pre-C99 define;
> > switch to using the standard LLONG_MAX instead.
> > 
> > This apparently fixes a compilation failure with certain
> > compiler/OS versions (though it is unclear which).
> > 
> > Reported-by: Peter Bartoli <peter@bartoli.org>
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> >  block/raw-posix.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Thanks, applied to the block branch.

Kevin
diff mbox

Patch

diff --git a/block/raw-posix.c b/block/raw-posix.c
index 6586a0c..b7f0f26 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1192,7 +1192,7 @@  again:
         if (size == 0)
 #endif
 #if defined(__APPLE__) && defined(__MACH__)
-        size = LONG_LONG_MAX;
+        size = LLONG_MAX;
 #else
         size = lseek(fd, 0LL, SEEK_END);
 #endif