Hi,

At Wed, 5 Oct 2005 00:14:40 +0900,
Christophe Poucet wrote in [ruby-core:06140]:
> I'm interested in inserting certain profiling templates into ruby for some
> experiments. This means that ruby must be c++-compileable. I started using
> 1.9 instead of 1.8 because I noticed a large effort had been made to step
> away from K&R function syntax to ANSI C function syntax, for which I am
> glad. After struggling with the compiler for a bit I finally managed to make
> it compile in c++. The steps that were required to achieve this were:

I doubt that all of them need to be C++ compileable.

> 1) make sure that all .c and .h files include something like
> #if defined(__cplusplus)
> extern "C" {
> #endif
> ... code
> #if defined(__cplusplus)
> }
> #endif

Currently, these headers don't contain extern "C".

  env.h intern.h missing.h re.h regenc.h regex.h regint.h
  regparse.h rubyio.h rubysig.h version.h

Almost are not intended to be included directly, and version.h
simply doesn't need it.  Perhaps, re.h and ruby{io,sig}.h only.

> 3) The last major effort was in regular expressions where the usage of
> unsigned char *, char* and UChar * flow through each other. I just followed
> the compiler and added appropriate casts.

I think it should be char* all, and just casts for dereferenced
char.

> 4) At certain points -1 is returned even though it's long, where I just
> added a cast. Also in certain places K&R syntax was still used

Where?

> One issue I had is that array test 37 and 38 (sample/test.rb 804 and 808)
> failed. Is this due to my changes or is this due to ruby 1.9? I'll try to
> compare but sadly I'm having issues keeping an active version of ruby on my
> computer at work given the fact that I'm firewalled and hence can not access
> your cvs port

No failures on my box.

-- 
Nobu Nakada