File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ uint64_t SizeOrThrow(int fd) {
111111
112112void  ResizeOrThrow (int  fd, uint64_t  to) {
113113#if  defined __MINGW32__
114-     //  Does this handle 64-bit?   
114+     //  Does this handle 64-bit?
115115    int  ret = ftruncate
116116#elif  defined(_WIN32) || defined(_WIN64)
117117    errno_t  ret = _chsize_s
@@ -128,8 +128,10 @@ namespace {
128128std::size_t  GuardLarge (std::size_t  size) {
129129  //  The following operating systems have broken read/write/pread/pwrite that
130130  //  only supports up to 2^31.
131+   //  OS X man pages claim to support 64-bit, but Kareem M. Darwish had problems
132+   //  building with larger files, so APPLE is also here.
131133#if  defined(_WIN32) || defined(_WIN64) || defined(__APPLE__) || defined(OS_ANDROID) || defined(__MINGW32__)
132-   return  std::min ( static_cast <std:: size_t >( static_cast < unsigned >(- 1 )),  size) ;
134+   return  size < INT_MAX ?  size : INT_MAX ;
133135#else 
134136  return  size;
135137#endif 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments