void-packages/srcpkgs/commoncpp2/patches/ftbfs.patch

24 lines
866 B
Diff

C++ does not allow specifying default arguments on friend declarations.
We can simply do this as getline is not otherwise publicly declared.
--- inc/cc++/string.h
+++ inc/cc++/string.h
@@ -731,7 +731,7 @@ public:
* @param delim deliminator to use.
* @param size optional size limitor.
*/
- friend __EXPORT std::istream &getline(std::istream &is, String &str, char delim = '\n', size_t size = 0);
+ friend __EXPORT std::istream &getline(std::istream &is, String &str, char delim, size_t size);
/**
* Stream the content of our string variable directly to a C++
@@ -743,7 +743,7 @@ public:
* Stream input into our variable.
*/
inline friend std::istream &operator>>(std::istream &is, String &str)
- {return getline(is, str);};
+ {return getline(is, str, '\n', 0);};
#ifdef HAVE_SNPRINTF
/**