Subject: pkg/23483: patches for devel/netcdf for gcc version 3.3.2
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mlh@goathill.org>
List: netbsd-bugs
Date: 11/18/2003 12:42:09
>Number:         23483
>Category:       pkg
>Synopsis:       devel/gcc version 3.3.2 doesn't build for gcc 3.3.2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 18 18:43:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     MLH
>Release:        NetBSD 1.6ZE
>Organization:
none
	
>Environment:
	
	
System: NetBSD kingu.sfbr.org 1.6ZE NetBSD 1.6ZE (APMLM) #0: Tue Oct 28 15:03:14
CST 2003 mlh@enki.sfbr.org:/opt/obj/usr/src/sys/arch/i386/compile/APMLM i386
Architecture: i386
Machine: i386
>Description:
devel/gcc version 3.3.2 doesn't build for gcc 3.3.2 as it uses old-style
includes.
>How-To-Repeat:
make devel/netcdf
>Fix:

I'm not sure how one might select for gcc < 3.x, but here are some
patches to allow it to build for 3.3.2.

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	diff
#	patches/patch-al
#	patches/patch-am
#
echo x - diff
sed 's/^X//' >diff << 'END-of-diff'
X? patches/patch-al
X? patches/patch-am
XIndex: distinfo
X===================================================================
XRCS file: /cvsroot/pkgsrc/devel/netcdf/distinfo,v
Xretrieving revision 1.7
Xdiff -b -u -r1.7 distinfo
X+++ distinfo	2003/11/18 18:34:12
X@@ -12,3 +12,5 @@
X SHA1 (patch-ai) = fb8386c47a2b0e2468bf31a424738979c472de94
X SHA1 (patch-aj) = beff85a29fa6407bde19bc2061b2082b4b5cb5d1
X SHA1 (patch-ak) = 7378c3ce65bb639051c385885e3a1d186514f697
X+SHA1 (patch-al) = a4da5a1ce34e90f6fe02d9e36d3eed6051cb2acb
X+SHA1 (patch-am) = ee842eb2ae66651d8449edf39fe602f733ac42d0
END-of-diff
echo x - patches/patch-al
sed 's/^X//' >patches/patch-al << 'END-of-patches/patch-al'
X$NetBSD$
X
X+++ cxx/ncvalues.cpp
X@@ -8,7 +8,8 @@
X  *********************************************************************/
X 
X-#include <iostream.h>		// for debugging
X #include "ncvalues.h"
X 
X+using namespace std;
X+
X NcValues::NcValues( void ) : the_number(0), the_type(ncNoType)
X {}
X@@ -311,5 +312,5 @@ ostream& NcValues_float::print(ostream& 
X     if (the_number > 0)
X       os << the_values[the_number-1] ;
X-    os.flags(save);
X+    os.flags((std::_Ios_Fmtflags) save);
X     return os;
X }
X@@ -323,5 +324,5 @@ ostream& NcValues_double::print(ostream&
X     if (the_number > 0)
X       os << the_values[the_number-1];
X-    os.flags(save);
X+    os.flags((std::_Ios_Fmtflags) save);
X     return os;
X }
END-of-patches/patch-al
echo x - patches/patch-am
sed 's/^X//' >patches/patch-am << 'END-of-patches/patch-am'
X$NetBSD$
X
X+++ cxx/ncvalues.h
X@@ -10,16 +10,17 @@
X #ifndef Ncvalues_def
X #define Ncvalues_def
X 
X-#include <iostream.h>
X+#include <iostream>
X #ifdef STRSTREAM_H_SPEC
X #   include STRSTREAM_H_SPEC
X #else
X-#   include <strstream.h>
X+#   include <sstream>
X #endif
X #include <limits.h>
X #include <string.h>
X #include "netcdf.h"
X 
X+using namespace std;
X typedef unsigned char ncbyte;
X 
X #define NC_UNSPECIFIED ((nc_type)0)
X@@ -220,7 +221,7 @@ inline double NcVal(TYPE)::as_double( lo
X char* NcVal(TYPE)::as_string( long n ) const				      \
X {									      \
X     char* s = new char[32];						      \
X-    ostrstream ostr(s, sizeof(s));                                            \
X+    ostringstream ostr(s, (std::_Ios_Openmode) sizeof(s));                    \
X     ostr << the_values[n] << ends;              			      \
X     return s;								      \
X }
END-of-patches/patch-am
exit

>Release-Note:
>Audit-Trail:
>Unformatted: