Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -908,6 +908,12 @@ #define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF #endif +#if !defined(_LIBCPP_HAS_OFF_T_FUNCTIONS) +#if !(defined(_WIN32) || defined(_NEWLIB_VERSION)) +#define _LIBCPP_HAS_OFF_T_FUNCTIONS +#endif +#endif + #endif // __cplusplus #endif // _LIBCPP_CONFIG 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_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_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_OFF_T_FUNCTIONS) if (fseek(__file_, -__c, SEEK_CUR)) return -1; #else