[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Two Lines of C in Ruby Source
From:       Brian Takita <brian.takita () gmail ! com>
Date:       2006-01-24 8:53:23
Message-ID: 1d7ddd110601240053n442c1e62s7096cce903784015 () mail ! gmail ! com
[Download RAW message or body]


> See defines.h for _ and __.
Thank you for the pointer. I found the defines.

#ifdef __cplusplus
# ifndef  HAVE_PROTOTYPES
#  define HAVE_PROTOTYPES 1
# endif
# ifndef  HAVE_STDARG_PROTOTYPES
#  define HAVE_STDARG_PROTOTYPES 1
# endif
#endif

#undef _
#ifdef HAVE_PROTOTYPES
# define _(args) args
#else
# define _(args) ()
#endif

#undef __
#ifdef HAVE_STDARG_PROTOTYPES
# define __(args) args
#else
# define __(args) ()
#endif

It looks like if __cplusplus is not defined, an empty argument field is
outputted. If __cplusplus is defined, the arguments are outputted by the
preprocessor.

... is a variable argument. stdarg.h is required for this.
More information can be found at
http://www.thinkage.ca/english/gcos/expl/c/incl/stdarg.html

> Ruby source and extensions are not good as a tutorial.
I'm trying to find out where the File name and line number of methods are
stored. So far my search has lead me to look in the backtrace function in
eval.c: line 6094.

If you have any pointers to lead me in the right direction, I would
appreciate it very much.

Of course, looking at the ruby c source requires me to learn some c. :)

Thank you,
Brian Takita


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic