This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.

Index Nav: Message Nav: [Date Index] [Subject Index] [Author Index] [Thread Index] [Date Prev] [Date Next] [Thread Prev] [Thread Next]

# RE: pthread definition and STL...

• To: 'Ales Pour' <pour at princip dot cz>, pthreads-win32 at sources dot redhat dot com
• Subject: RE: pthread definition and STL...
• From: "Bossom, John" <John dot Bossom at Cognos dot COM>
• Date: Tue, 16 Jan 2001 10:38:01 -0500

```The C language allows defining pointers to undeclared structs.
The implementation took advantage of this fact in order to
accomplish two goals:

1) Hide the implementation from the users... you should be able
to rebuild the library/dll and drop it in without having to
recompile the user's code. This is accomplished by only
defining the structures for the actual implementation. The
users are only exposed to pointers to undefined structs.

2) Taking into account 1), instead of simply using the definition
which would work,
using
allows stronger type checking in that you cannot pass a pthread_t
accidentally into, say, a method expecting a mutex
(whereas, declaring them all (void *)looses this.

To come up with a solution that would preserve the above two points
needs to be investigated.
Your workaround of including "implement.h" (previously posted) will
work in the short term.

I'll see if I can work out a solution that will permit you to use
STL with these incomplete pointers.

John
-----Original Message-----
From: Ales Pour [mailto:pour@princip.cz]
Sent: January 16, 2001 4:19 AM
Subject: Re: pthread definition and STL...

"Bossom, John" wrote:
> What error are you getting from the system?

Compilation stops with:

...\include\stl\stl_construct.h(58) : error C2027: use of undefined type

This is in case of SGI's STL. With MSVC's (Dinkumware's?) STL its the
same error:

...\VC\INCLUDE\xmemory(33) : error C2027: use of undefined type