--- "Clayton, Nik" wrote: 
> Any "Writing thread safe libraries for dummies" texts you could point
> me at?

I recommend "Programming with POSIX Threads" by David Butenhof.

Re the varargs ok() business, I assume you'll be using some sort of
config.h with your libtap library. Any plans on using autoconf or
similar tool?

One way around this __VA_ARGS__ portability issue is to let
configure work it out and write your code for some sort of
"VA_ARGS" capability. There doesn't appear to be a standard
autoconf symbol for this, at least I couldn't find one.
Googling for HAVE_VA_ARGS uncovered only two dubious hits.
<http://gcc.gnu.org/ml/gcc-help/2004-05/msg00181.html>
asked a question about this issue, but no response.

I noticed this in a "issue with glib.h" gtk-devel-list thread:

I think we should just use the __STDC_VERSION__ define -- no need
for autoconf.

#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
# define g_message(...) g_log (DOM, LOG_MSG, __VA_ARGS__)
#elif defined __GNUC__
# define g_message(format_args...) g_log (DOM, LOG_MSG, format_args)
#else
...
#endif

Finally, ACE C++ library uses:

#if defined (__GNUC__) && (__GNUC__ >= 3 || __GNUC_MINOR__ > 95)
  // use GNU __VA_ARGS__ capability ...

HTH,
/-\


Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

Reply via email to