From 967294dbd8fdc52b4d98ec4fda3e9a1a5a059d11 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 8 Jul 2009 16:31:01 +0000 Subject: [PATCH] * Turns out that the "upper" half of the old (gcc2) libio - the C++ classes - keeps its own idea about what a wchar_t is and that was still a short. This of course made the data structure of a streambuf incompatible with the "lower" half - the glibc part - causing (potentially all sorts of) crashes when these classes were used. This should fix the crash of gensyscalls when building haiku natively on a gcc2-haiku. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31462 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/cpp/streambuf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/cpp/streambuf.h b/headers/cpp/streambuf.h index 193c499382..52f5a963ee 100644 --- a/headers/cpp/streambuf.h +++ b/headers/cpp/streambuf.h @@ -58,7 +58,7 @@ extern "C" { #if _G_IO_IO_FILE_VERSION == 0x20001 #define _IO_wchar_t _G_wchar_t #else -#define _IO_wchar_t short +#define _IO_wchar_t wchar_t #endif #endif @@ -320,7 +320,7 @@ struct streambuf : public _IO_FILE { // protected?? void setp(char* p, char* ep) { _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; } void setg(char* eb, char* g, char *eg) { - if (_IO_file_flags & _IO_IN_BACKUP) _IO_free_backup_area(this); + if (_IO_file_flags & _IO_IN_BACKUP) _IO_free_backup_area(this); _IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; } char *shortbuf() { return _shortbuf; } @@ -342,7 +342,7 @@ struct streambuf : public _IO_FILE { // protected?? void unsave_markers(); // Make all streammarkers !saving(). int put_mode() { return _flags & _IO_CURRENTLY_PUTTING; } int switch_to_get_mode(); - + streambuf(int flags=0); public: static int flush_all();