delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/04/22/18:06:53

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
X-Authentication-Warning: modi.xraylith.wisc.edu: khan owned process doing -bs
Date: Thu, 22 Apr 1999 17:05:54 -0500 (CDT)
From: Mumit Khan <khan AT xraylith DOT wisc DOT edu>
To: ioconnor AT Siac DOT COM
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Does <auto_ptr> work with gcc in cygwin land?s
In-Reply-To: <199904222048.QAA25978@pub.siac.com>
Message-ID: <Pine.SUN.3.93.990422163816.24617L-100000@modi.xraylith.wisc.edu>
MIME-Version: 1.0

On Thu, 22 Apr 1999 ioconnor AT Siac DOT COM wrote:

> I downloaded full.exe from the latest directory and attempted to compile a
> program that uses <auto_ptr>. Unfortunately it didn't work.
> 
> How does one go about getting a working version of gcc which can handle
> <auto_ptr>? (Does it exist?!)

before getting down to auto_ptr<> details,

- the c++ compiler distributed with full.exe is quite old by now, and
  there've been 2 releases since then. I suggest you pick up a copy of
  egcs-1.1.2 (http://www.xraylith.wisc.edu/~khan/software/gnu-win32/).

- EGCS releases to date use the older SGI STL that didn't include an
  compliant version of auto_ptr, and had it commented out in memory.h.
  This is the case for egcs-1.1.2 as well; the next major release of
  egcs, 1.2, will have the latest SGI STL, with auto_ptr and all.

To use auto_ptr (after downloading egcs-1.1.2 of course), you can do one
of two things:

1. Re-enable the auto_ptr in the STL distributed with egcs-1.1.2. You can
   use the following trivial patch. The patch assumes source distribution,
   but you can just as easily apply to the installed copy as well.

Thu Mar 15 22:01:16 1999  Mumit Khan  <khan AT xraylith DOT wisc DOT edu>

	* stl/memory.h (auto_ptr): Enable for egcs-1.1.2 and fix const
	bug in release().

--- stl/memory	Mon Mar 15 12:12:08 1999
+++ stl/memory	Mon Apr 15 21:46:55 1999
@@ -26,8 +26,8 @@
 //  of the interface are still being discussed by the C++ standardization
 //  committee.  It will be included once the iterface is finalized.
 
-#if 0
-#if defined(_MUTABLE_IS_KEYWORD) && defined(_EXPLICIT_IS_KEYWORD) && \
+#if 1
+#if 1 || defined(_MUTABLE_IS_KEYWORD) && defined(_EXPLICIT_IS_KEYWORD) && \
     defined(__STL_MEMBER_TEMPLATES)
 
 __STL_BEGIN_NAMESPACE
@@ -73,7 +73,7 @@ public:
   X& operator*() const __STL_NOTHROW { return *ptr; }
   X* operator->() const __STL_NOTHROW { return ptr; }
   X* get() const __STL_NOTHROW { return ptr; }
-  X* release const __STL_NOTHROW { owns = false; return ptr }
+  X* release () __STL_NOTHROW { owns = false; return ptr; }
 };
 
 __STL_END_NAMESPACE


2. Or, get the latest SGI STL and use it with egcs-1.1.2.

Regards,
Mumit




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019