Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72278 - trunk/libs/filesystem/v3/src
From: bdawes_at_[hidden]
Date: 2011-05-30 08:33:15


Author: bemandawes
Date: 2011-05-30 08:33:14 EDT (Mon, 30 May 2011)
New Revision: 72278
URL: http://svn.boost.org/trac/boost/changeset/72278

Log:
Fix #5355, QNX large file issues. Thanks to Niklas Angare for investigating, patch, and testing.
Text files modified:
   trunk/libs/filesystem/v3/src/operations.cpp | 60 ++++++++++++++++++---------------------
   1 files changed, 28 insertions(+), 32 deletions(-)

Modified: trunk/libs/filesystem/v3/src/operations.cpp
==============================================================================
--- trunk/libs/filesystem/v3/src/operations.cpp (original)
+++ trunk/libs/filesystem/v3/src/operations.cpp 2011-05-30 08:33:14 EDT (Mon, 30 May 2011)
@@ -10,6 +10,25 @@
 
 //--------------------------------------------------------------------------------------//
 
+// define 64-bit offset macros BEFORE including boost/config.hpp (see ticket #5355)
+#if !(defined(__HP_aCC) && defined(_ILP32) && !defined(_STATVFS_ACPP_PROBLEMS_FIXED))
+#define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect,
+#endif
+#if !defined(__PGI)
+#define __USE_FILE_OFFSET64 // but that is harmless on Windows and on POSIX
+ // 64-bit systems or on 32-bit systems which don't have files larger
+ // than can be represented by a traditional POSIX/UNIX off_t type.
+ // OTOH, defining them should kick in 64-bit off_t's (and thus
+ // st_size)on 32-bit systems that provide the Large File
+ // Support (LFS)interface, such as Linux, Solaris, and IRIX.
+ // The defines are given before any headers are included to
+ // ensure that they are available to all included headers.
+ // That is required at least on Solaris, and possibly on other
+ // systems as well.
+#else
+#define _FILE_OFFSET_BITS 64
+#endif
+
 #include <boost/config.hpp>
 #if !defined( BOOST_NO_STD_WSTRING )
 // Boost.Filesystem V3 and later requires std::wstring support.
@@ -30,30 +49,18 @@
 # define _POSIX_PTHREAD_SEMANTICS // Sun readdir_r()needs this
 #endif
 
-#if !defined(__QNXNTO__) && !(defined(__HP_aCC) && defined(_ILP32) && \
- !defined(_STATVFS_ACPP_PROBLEMS_FIXED))
-#define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect,
-#endif
-#if !defined(__PGI)
-#define __USE_FILE_OFFSET64 // but that is harmless on Windows and on POSIX
- // 64-bit systems or on 32-bit systems which don't have files larger
- // than can be represented by a traditional POSIX/UNIX off_t type.
- // OTOH, defining them should kick in 64-bit off_t's (and thus
- // st_size)on 32-bit systems that provide the Large File
- // Support (LFS)interface, such as Linux, Solaris, and IRIX.
- // The defines are given before any headers are included to
- // ensure that they are available to all included headers.
- // That is required at least on Solaris, and possibly on other
- // systems as well.
-#else
-#define _FILE_OFFSET_BITS 64
-#endif
-
 #include <boost/filesystem/v3/operations.hpp>
 #include <boost/scoped_array.hpp>
 #include <boost/detail/workaround.hpp>
-#include <cstdlib> // for malloc, free
-#include <vector>
+#include <vector>
+#include <cstdlib> // for malloc, free
+#include <sys/stat.h> // even on Windows some functions use stat()
+#include <cstring>
+#include <cstdio> // for remove, rename
+#if defined(__QNXNTO__) // see ticket #5355
+# include <stdio.h>
+#endif
+#include <cerrno>
 
 #ifdef BOOST_FILEYSTEM_INCLUDE_IOSTREAM
 # include <iostream>
@@ -178,17 +185,6 @@
 # define BOOST_FILESYSTEM_STATUS_CACHE
 # endif
 
-#include <sys/stat.h> // even on Windows some functions use stat()
-#include <string>
-#include <cstring>
-#include <cstdio> // for remove, rename
-#if defined(__QNXNTO__) // see ticket #5355
-# include <stdio.h>
-#endif
-#include <cerrno>
-#include <cassert>
-// #include <iostream> // for debugging only; comment out when not in use
-
 // POSIX/Windows macros ----------------------------------------------------//
 
 // Portions of the POSIX and Windows API's are very similar, except for name,


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk