Skip to contentSkip to conversation

block/raw-posix.c: Avoid nonstandard LONG_LONG_MAX

PATCH In review Peter Maydell 2 participants 2 messages May 23, 2014 – May 26, 2014 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/raw-posix.c: Avoid nonstandard LONG_LONG_MAX

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).

---
 block/raw-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/raw-posix.c +1 -1
index 6586a0c..b7f0f26 100644
@@ -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
Signature · 1 line
1.8.5.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Peter Maydell

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.

Quoted 8 lines

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

---
 block/raw-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)