Hi,

Kimmo sent this to me by mistake.

--- Begin Message ---
[EMAIL PROTECTED] (Alfred M. Szmidt) writes:

> And I hope that nobody will check in those patches. I fully agree with you
> Thomas. Cluttering up the code with crap is pointless.

Me too. That is, I don't see the point in alteribg the
original C header in order to support C++
compilers. After all, the original header is a C header
file. However, I see lots of points in providing a C++
header for C++ users. Here is a basic skeleton that might
work. The implicit conversions still need some workarounds.


-------------cut here-------------------------
// cthreads.hpp
#ifndef CTHREADS_HPP
#define CTHREADS_HPP

#ifndef __cplusplus
#error only c++ compilers are supported here.
#endif

#define catch take

extern "C" {

#include "cthreads.h"

}

#undef catch

#endif // CTHREADS_HPP
-------------------cut here------------------

The above is not a piece of tested code. It is a sample of
concept. I know that cthreads is evil and should not be
used since pthreads is much more portable, cleaner, more
beautiful ang righteous. The concept is still something that
might be worth a thought. Don't tweak C headers, create C++
wrapper headers instead.

Kusti - just my 2 cents
-- 
Kimmo K. I. Surakka <[EMAIL PROTECTED]>
Additional information available at http://www.iki.fi/kusti/
Link of the day: http://www.stoptorture.org/



--- End Message ---

-- 
Alfred M. Szmidt

Reply via email to