A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2000-August/008512.html below:

typedef ??? pthread_t and hacky return statements

[Python-Dev] pthreads question: typedef ??? pthread_t and hacky return statements [Python-Dev] pthreads question: typedef ??? pthread_t and hacky return statementsTrent Mick trentm@ActiveState.com
Fri, 18 Aug 2000 09:56:24 -0700
On Fri, Aug 18, 2000 at 04:00:34AM -0700, Greg Stein wrote:
> That is a silly approach, Tim. This is exactly what autoconf is for. Using
> run-time logic to figure out something that is compile-time is Badness.
> 
> > > On Thu, Aug 17, 2000 at 11:39:29PM -0400, Tim Peters wrote:
> > >
> > > > So how about a runtime test for what's actually important (and it's not
> > > > Monterey!)?
> > > >
> > > > 	if (sizeof(threadid) <= sizeof(long))
> > > > 		return (long)threadid;
> > > >
> > > > End of problem, right?  It's a cheap runtime test in a function
> > > > whose speed isn't critical anyway.
> > >

I am inclined to agrre with Thomas and Greg on this one. Why not check for
sizeof(pthread_t) if pthread.h exists and test:

#if SIZEOF_PTHREAD_T < SIZEOF_LONG
    return (long)threadid;
#endif


Trent

-- 
Trent Mick
TrentM@ActiveState.com



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4