[PATCH] D25741: [libc++] Add configuration define for off_t functions

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 31 08:18:50 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL285582: [libc++] Add configuration define for off_t functions (authored by smeenai).

Changed prior to commit:
  https://reviews.llvm.org/D25741?vs=75142&id=76411#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25741

Files:
  libcxx/trunk/include/__config
  libcxx/trunk/include/fstream


Index: libcxx/trunk/include/fstream
===================================================================
--- libcxx/trunk/include/fstream
+++ libcxx/trunk/include/fstream
@@ -813,7 +813,7 @@
     default:
         return pos_type(off_type(-1));
     }
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
     if (fseek(__file_, __width > 0 ? __width * __off : 0, __whence))
         return pos_type(off_type(-1));
     pos_type __r = ftell(__file_);
@@ -832,7 +832,7 @@
 {
     if (__file_ == 0 || sync())
         return pos_type(off_type(-1));
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
     if (fseek(__file_, __sp, SEEK_SET))
         return pos_type(off_type(-1));
 #else
@@ -896,7 +896,7 @@
                 }
             }
         }
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
         if (fseek(__file_, -__c, SEEK_CUR))
             return -1;
 #else
Index: libcxx/trunk/include/__config
===================================================================
--- libcxx/trunk/include/__config
+++ libcxx/trunk/include/__config
@@ -904,6 +904,12 @@
 #define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
 #endif
 
+#if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
+#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
+#endif
+#endif
+
 #endif // __cplusplus
 
 #endif // _LIBCPP_CONFIG


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25741.76411.patch
Type: text/x-patch
Size: 1454 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161031/e5453964/attachment.bin>


More information about the cfe-commits mailing list