*** cxx/ncvalues.h.orig 2002-07-31 03:03:17.000000000 +0930 --- cxx/ncvalues.h 2002-07-31 03:26:14.000000000 +0930 *************** *** 10,25 **** #ifndef Ncvalues_def #define Ncvalues_def ! #include ! #ifdef STRSTREAM_H_SPEC ! # include STRSTREAM_H_SPEC ! #else ! # include ! #endif #include #include #include "netcdf.h" ! typedef unsigned char ncbyte; #define NC_UNSPECIFIED ((nc_type)0) --- 10,22 ---- #ifndef Ncvalues_def #define Ncvalues_def ! #include ! #include ! extern "C" { #include #include #include "netcdf.h" ! } typedef unsigned char ncbyte; #define NC_UNSPECIFIED ((nc_type)0) *************** *** 82,88 **** virtual int invalid( void ) const; \ private: \ TYPE* the_values; \ ! ostream& print(ostream&) const; \ }; #define NcTypeEnum(TYPE) makename2(_nc__,TYPE) --- 79,85 ---- virtual int invalid( void ) const; \ private: \ TYPE* the_values; \ ! std::ostream& print(std::ostream&) const; \ }; #define NcTypeEnum(TYPE) makename2(_nc__,TYPE) *************** *** 218,228 **** #define as_string_implement(TYPE) \ char* NcVal(TYPE)::as_string( long n ) const \ ! { \ char* s = new char[32]; \ ! ostrstream ostr(s, sizeof(s)); \ ! ostr << the_values[n] << ends; \ ! return s; \ } class NcValues // ABC for value blocks --- 215,227 ---- #define as_string_implement(TYPE) \ char* NcVal(TYPE)::as_string( long n ) const \ ! { \ char* s = new char[32]; \ ! ostringstream ostr; \ ! ostr << the_values[n]; \ ! strncpy(s,ostr.str().c_str(),32); \ ! s[31]=0; \ ! return s; \ } class NcValues // ABC for value blocks *************** *** 232,238 **** NcValues(NcType, long); virtual ~NcValues( void ); virtual long num( void ); ! virtual ostream& print(ostream&) const = 0; virtual void* base( void ) const = 0; virtual int bytes_for_one( void ) const = 0; --- 231,237 ---- NcValues(NcType, long); virtual ~NcValues( void ); virtual long num( void ); ! virtual std::ostream& print(std::ostream&) const = 0; virtual void* base( void ) const = 0; virtual int bytes_for_one( void ) const = 0; *************** *** 252,258 **** protected: NcType the_type; long the_number; ! friend ostream& operator<< (ostream&, const NcValues&); }; declare(NcValues,ncbyte) --- 251,257 ---- protected: NcType the_type; long the_number; ! friend std::ostream& operator<< (std::ostream&, const NcValues&); }; declare(NcValues,ncbyte) *** cxx/ncvalues.cpp.orig 2002-07-31 03:12:52.000000000 +0930 --- cxx/ncvalues.cpp 2002-07-31 03:13:56.000000000 +0930 *************** *** 7,15 **** * $Header: /var/cvsroot/gentoo-x86/sci-libs/netcdf/files/gcc3-gentoo.patch,v 1.1 2004/12/28 18:29:26 ribosome Exp $ *********************************************************************/ ! #include // for debugging #include "ncvalues.h" NcValues::NcValues( void ) : the_number(0), the_type(ncNoType) {} --- 7,17 ---- * $Header: /var/cvsroot/gentoo-x86/sci-libs/netcdf/files/gcc3-gentoo.patch,v 1.1 2004/12/28 18:29:26 ribosome Exp $ *********************************************************************/ ! #include // for debugging #include "ncvalues.h" + using namespace std; + NcValues::NcValues( void ) : the_number(0), the_type(ncNoType) {} *************** *** 304,310 **** ostream& NcValues_float::print(ostream& os) const { ! long save=os.flags(); os.precision(7); for(int i = 0; i < the_number - 1; i++) os << the_values[i] << ", "; --- 306,312 ---- ostream& NcValues_float::print(ostream& os) const { ! ios::fmtflags save=os.flags(); os.precision(7); for(int i = 0; i < the_number - 1; i++) os << the_values[i] << ", "; *************** *** 316,322 **** ostream& NcValues_double::print(ostream& os) const { ! long save=os.flags(); os.precision(15); for(int i = 0; i < the_number - 1; i++) os << the_values[i] << ", "; --- 318,324 ---- ostream& NcValues_double::print(ostream& os) const { ! ios::fmtflags save=os.flags(); os.precision(15); for(int i = 0; i < the_number - 1; i++) os << the_values[i] << ", "; *** cxx/netcdfcpp.h.orig 2002-07-31 03:07:35.000000000 +0930 --- cxx/netcdfcpp.h 2002-07-31 03:07:56.000000000 +0930 *************** *** 154,160 **** virtual ~NcDim( void ); // to construct dimensions, since constructor is private ! friend NcFile; }; --- 154,160 ---- virtual ~NcDim( void ); // to construct dimensions, since constructor is private ! friend class NcFile; }; *************** *** 357,363 **** void init_cur( void ); // to make variables, since constructor is private ! friend NcFile; }; --- 357,363 ---- void init_cur( void ); // to make variables, since constructor is private ! friend class NcFile; }; *************** *** 388,394 **** NcAtt( NcFile*, NcToken); // global attribute // To make attributes, since constructor is private ! friend NcFile; friend NcAtt* NcVar::get_att( NcToken ) const; }; --- 388,394 ---- NcAtt( NcFile*, NcToken); // global attribute // To make attributes, since constructor is private ! friend class NcFile; friend NcAtt* NcVar::get_att( NcToken ) const; }; *** cxx/nctst.cpp.orig 2002-07-31 04:00:10.000000000 +0930 --- cxx/nctst.cpp 2002-07-31 04:00:19.000000000 +0930 *************** *** 1,7 **** ! #include #include #include "netcdfcpp.h" void gen(const char* path) // Generate a netCDF file { NcFile nc(path, NcFile::Replace); // Create, leave in define mode --- 1,9 ---- ! #include #include #include "netcdfcpp.h" + using namespace std; + void gen(const char* path) // Generate a netCDF file { NcFile nc(path, NcFile::Replace); // Create, leave in define mode