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

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 19 06:53:25 PDT 2016


smeenai updated this revision to Diff 75142.
smeenai added a comment.

Addressing @mclow.lists's comment


https://reviews.llvm.org/D25741

Files:
  include/__config
  include/fstream


Index: include/fstream
===================================================================
--- include/fstream
+++ 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: include/__config
===================================================================
--- include/__config
+++ include/__config
@@ -908,6 +908,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.75142.patch
Type: text/x-patch
Size: 1376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161019/8cb7e2d1/attachment-0001.bin>


More information about the cfe-commits mailing list