sibojia / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

strstream is deprecated #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With regard to deprecation, support of strstream could be removed from future 
versions of compilers. Actually in my environment there isn't one.

Can we replace strstream with stringstream or make it an option? Maybe through 
some HAVE_STRSTREAM flag? Is there any performance advantage of using strstream?

Original issue reported on code.google.com by Van...@gmail.com on 16 Jan 2012 at 4:23

GoogleCodeExporter commented 9 years ago
This makes linking fail on OSX using clang++ (3.0) with -std=c++0x and 
-stdlib=libc++. The attached patch fixes the problem, which is that strstream 
doesn't exist with these options.

Original comment by joaodasilva@chromium.org on 22 Jan 2012 at 1:50

Attachments:

GoogleCodeExporter commented 9 years ago
Can we also replace ostrstream with ostringstream ?

Original comment by Van...@gmail.com on 23 Jan 2012 at 10:49

GoogleCodeExporter commented 9 years ago
Here is a patch that replaces strstream with stringstream and removes inclusion 
of deprecated header.

Signed the "Individual Contributor License Agreement" form, so you can use the 
code.

Original comment by Van...@gmail.com on 23 Jan 2012 at 2:03

Attachments:

GoogleCodeExporter commented 9 years ago
Oops, seems like ostringstream doesn't support specifying char buffer as a 
backend. Sad :(

Original comment by Van...@gmail.com on 23 Jan 2012 at 2:38

GoogleCodeExporter commented 9 years ago
I think I can implement a custom std::stringbuf  as suggested here:
http://stackoverflow.com/questions/1494182/setting-the-internal-buffer-used-by-a
-standard-stream-pubsetbuf

Or just copy output string using stringstream::str() function

Original comment by Van...@gmail.com on 15 Mar 2012 at 9:34

GoogleCodeExporter commented 9 years ago
I have a multiplatform project using glog, and this deprecated support to 
strstream happened to me while building the library to Android.

I'm attaching a patch for the SVN version (revision 115). Actually, it solves 
two problems at once: removes the deprecated strstream usage (and some 
old-style char pointer vectors), and includes the flag HAVE_POSIX_FADVISE and 
ANDROID to the build, making the library compatible with Android NDK (tested 
against android-ndk-r8).

This patch has been tested over Windows, Linux, Mac OSX, Android and iOS, but 
using an alternative build system (CMake).

Original comment by gu...@nymgo.com on 23 Oct 2012 at 10:12

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry for the latency...

Thanks for the patch! But, sorry, google's internal version of glog has already 
fixed this issue, so I'd use the internal version to minimize diffs between the 
opensource version and the internal version.

http://code.google.com/p/google-glog/source/detail?r=119

I cannot test the android part of your patch right now. If you kindly update 
the patch for android, I'll apply it. Otherwise, I'll try to modify your patch.

Anyway, we need to ask you to sign our Contributor License Agreement. If you 
didn't yet, could you sign our Individual Contributor License Agreement, 
please? It
seems that we need to ask you to sign this to avoid any troubles. The
process is just submitting an HTML form, and it shouldn't take your
time so much.

http://code.google.com/legal/individual-cla-v1.0.html

Please note that these forms do not transfer copyright: the
contributor retains her ownership in the work. The CLA just grants
Google a "perpetual, non-exclusive, royalty-free, etc..." right to use
the work, sublicense it, and so on.

Original comment by shinichi...@gmail.com on 9 Jan 2013 at 4:13

GoogleCodeExporter commented 9 years ago
I fixed this using google's internal change.

http://code.google.com/p/google-glog/source/detail?r=119

Original comment by shinichi...@gmail.com on 25 Jan 2013 at 6:28