[#8123] Unit/Regression tests for Ruby builtin classes and modules — Wayne Kelly <w.kelly@...>
[#8129] segmentation fault while evaluating printf:Kernel — <noreply@...>
Bugs item #4949, was opened at 2006-07-05 18:03
[#8131] thread mystery — ara.t.howard@...
[#8132] rdoc, C extensions, stop and start — "Daniel Berger" <Daniel.Berger@...>
Hi,
[#8136] Confused exception handling in Continuation Context — "Robert Dober" <robert.dober@...>
Hi all
Robert Dober schrieb:
On 7/6/06, Pit Capitain <pit@capitain.de> wrote:
Hi,
[#8142] thread/sync.rb memory corruption — ara.t.howard@...
Could someone please confirm this can be reproduced on 1.8.5 pre1?
On Thu, 6 Jul 2006, URABE Shyouhei wrote:
[#8167] bug in printf — <noreply@...>
Bugs item #4970, was opened at 2006-07-07 14:18
Hi,
On 7/25/06, nobu@ruby-lang.org <nobu@ruby-lang.org> wrote:
Hi,
[#8169] next in ensure body (Ruby 1.8.x) — "Dominik Bathon" <dbatml@...>
Hi,
[#8180] Called method not removed after remove_method — <noreply@...>
Bugs item #4998, was opened at 2006-07-09 13:20
[#8194] rss patch -- mostly doc, plus English adjustments. — Hugh Sasse <hgs@...>
This is a patch set against the stable snapshot.
Hi,
[#8196] SONY VIAOLAPTOP-------------$750USD,NOKIA N93-------------------$250USD — <noreply@...>
Bugs item #5032, was opened at 2006-07-12 18:41
I think this is more of an enhancement...
> Subject: Re: [ ruby-Bugs-5032 ] SONY
[#8201] Please implement expect.rb for Windows Ruby — <noreply@...>
Bugs item #5036, was opened at 2006-07-12 14:44
Hi,
Yukihiro Matsumoto wrote:
Hi,
[#8203] Re: [PATCH] --fqname option to test/unit/autorunner.rb — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
Thanks again for getting back to me. Perhaps my original focus on the
[#8222] Rdoc patch for lib/prettyprint.rb — Hugh Sasse <hgs@...>
This is a first pass at converting the RDTool docs for lib/prettyprint.rb
[#8223] Unexpected pointer behavior with unpack — "Justin Bailey" <jgbailey@...>
I have had the opportunity to work [1] a lot with Ruby's ability to create
[#8229] open-uri fails under multithreading — <noreply@...>
Bugs item #5067, was opened at 2006-07-14 19:11
[#8243] tuplespace - make comments visible to rdoc. — Hugh Sasse <hgs@...>
comments in rdoc conventionally don't start with two # marks and don't
On Jul 17, 2006, at 10:09 AM, Hugh Sasse wrote:
That 'doesn't add anything' is meant to the last paragraph, as i understood it.
On Tue, 18 Jul 2006, Jan Svitok wrote:
[#8248] One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...>
I just posted this to ruby-talk. But I would also like to discuss this
Dear Curt,
On 7/20/06, Kaspar Schiess <eule@space.ch> wrote:
I was wondering if the toolchain could be built around rake?
The One-Click Ruby Installer's build process is, in fact, controlled via
From my experience using both tool chains on Windows (for the ruby-prof
Tim, I'm going to top reply since your post was so long. I'm interested in
> Tim, I'm going to top reply since your post was so long. I'm interested in
On 7/19/06, Charlie Savage <cfis@savagexi.com> wrote:
Curt Hibbs wrote:
On 7/19/06, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
Hello,
[#8262] Instability around popen due to missing rb_thread_atfork — <noreply@...>
Patches item #5111, was opened at 2006-07-18 22:36
Hi,
On 19 Jul 2006, at 8:25, <nobu@ruby-lang.org> <nobu@ruby-lang.org>
[#8271] my sandboxing extension!! — why the lucky stiff <ruby-core@...>
I have (what feels like) very exciting news. I finally sat down to code up my
On Wed, Jul 19, 2006 at 06:40:34PM +0900, why the lucky stiff wrote:
On Wed, Jul 19, 2006 at 08:00:15PM +0900, Mauricio Fernandez wrote:
On Wed, Jul 19, 2006 at 11:18:27PM +0900, why the lucky stiff wrote:
Okay, it turns out that, in order for this to work, I also need the following
Hi,
On Thu, Jul 20, 2006 at 03:11:34PM +0900, Yukihiro Matsumoto wrote:
Hi,
On 7/20/06, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
[#8273] Regular-Expressions Problem/Bug — Reto Schuettel <reto-ruby-core@...>
Hi
On Wed, 19 Jul 2006, Reto Schuettel wrote:
Hi
>>>>> "R" == Reto Schuettel <reto-ruby-core@schuettel.ch> writes:
[#8299] Interest in NTLM/Negotiate patch for net/http? — "Justin Bailey" <jgbailey@...>
My workplace recently installed Microsoft's ISA server, which proxies all
On Jul 19, 2006, at 5:01 PM, Justin Bailey wrote:
[#8331] (Fwd) Re: Patch to Ruby in 2005 — "John Fletcher" <J.P.Fletcher@...>
Hi
Hi,
On Fri, 21 Jul 2006, nobu@ruby-lang.org wrote:
[#8379] rdoc grows to large size. — Hugh Sasse <hgs@...>
While working on that .document patch I noticed that rdoc grew to
On Jul 24, 2006, at 6:09 AM, Hugh Sasse wrote:
[#8394] Re: rdoc grows to large size. — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
[#8423] doc patch: readbytes.rb — Hugh Sasse <hgs@...>
A patch against the stable snapshot.
[#8427] RDoc picking up comments from function prototypes — Tilman Sauerbeck <tilman@...>
Hi,
Tilman Sauerbeck [2006-07-29 02:39]:
On Aug 9, 2006, at 9:52 AM, Tilman Sauerbeck wrote:
[#8430] Re: doc patch: weakref. — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
Hi,
Yukihiro Matsumoto wrote:
On Sat, Jul 29, 2006 at 07:37:24PM +0900, Daniel Berger wrote:
On Sun, 30 Jul 2006, Mauricio Fernandez wrote:
On Jul 31, 2006, at 3:20 AM, Hugh Sasse wrote:
On Tue, 1 Aug 2006, Eric Hodel wrote:
On Aug 1, 2006, at 2:13 AM, Hugh Sasse wrote:
[#8441] Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...>
I have the following code:
Hi,
Why does this:
Hi,
So to clarify...
I don't want to take this thread off-course, but what I meant was
On Mon, 31 Jul 2006, Matt Todd wrote:
On 7/30/06, Mathieu Bouchard <matju@artengine.ca> wrote:
Awesome. Thank you very much for your responses. Curious. I knew a
On 7/31/06, Matt Todd <chiology@gmail.com> wrote:
[#8447] #if should be #ifdef in ruby.h — <noreply@...>
Bugs item #5243, was opened at 2006-07-30 16:31
noreply@rubyforge.org wrote:
[#8466] Multi-Line Date Formate Patch — James Edward Gray II <james@...>
It was pointed out to me that the following code is surprising:
On Jul 31, 2006, at 8:26 AM, James Edward Gray II wrote:
Hi,
Re: [PATCH] Some rdoc for mkmf
--- nobu@ruby-lang.org wrote:
> Hi,
>
> At Sun, 9 Jul 2006 03:11:44 +0900,
> Daniel Berger wrote in [ruby-core:08177]:
> > Attached is an rdoc patch for what I believe are
> the
> > most used methods of mkmf. They include docs for:
>
> Thank you for the great job.
>
> > check_sizeof
>
> I guess checking exact size of a type is less
> necessary in
> common. Checking trueness of an expression might be
> enough in
> most cases, I guess.
>
> E.g.:
>
> def check_iftrue(expr, headers = nil, &b)
> checking_for("if #{expr}") do
> try_static_assert(expr, headers, &b)
> end
> end
>
> check_iftrue("sizeof(long) == sizeof(void*)")
>
> than:
>
> check_sizeof("void*") == check_sizeof("long")
Probably. What would it return for a preprocessor
constant, if any? Well, I leave it up to you.
>
> > check_sizeof
> > have_library
> > have_struct_member
> > have_type
>
> And these 4 methods accepts a name or a list for
> headers.
Ok, I've updated the docs to reflect this and modified
the source a tiny bit to use the word 'headers'
instead of 'header' to indicate to programmers that it
can take more than one.
>
> > Also, I was wondering if we could get the
> have_const
> > method added in, as per Nobu's patch in
> > ruby-core:4426.
>
> It worked for integral constants only. Now I guess
> have_macro
> and have_var would do the role instead. Any idea?
Neither of those work for checking the presence of an
enum typedef member in my experiments. See
ruby-core:4422. Perhaps I've made a mistake, though.
What is the purpose of allowing a block to methods
like have_header? I can see within create_tmpsrc that
it does 'src = yield(src) if block_given?'. How would
one use a block in practice? Or is it an artifact of
some sort?
Also, should we tag the methods that aren't meant for
public use with :no-doc: tags? Or perhaps move all of
these methods into Kernel, and designate private
methods?
Attached is the updated diff.
Regards,
Dan
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Attachments (1)
--- mkmf.orig Fri Jun 02 02:16:44 2006
+++ mkmf.rb Sun Jul 09 11:01:41 2006
@@ -547,6 +547,11 @@
r
end
+# Returns whether or not +macro+ is defined either in the common header
+# files or within any +headers+ you provide.
+#
+# Any options you pass to +opt+ are passed along to the compiler.
+#
def have_macro(macro, headers = nil, opt = "", &b)
m = "#{macro}"
m << " in #{headers.inspect}" if headers
@@ -555,7 +560,15 @@
end
end
-def have_library(lib, func = nil, header=nil, &b)
+# Returns whether or not the given entry point +func+ can be found within
+# +lib+. If +func+ is nil, the 'main()' entry point is used by default.
+# If found, it adds the library to list of libraries to be used when linking
+# your extension.
+#
+# If +headers+ are provided, it will include those header files as the
+# header files it looks in when searching for +func+.
+#
+def have_library(lib, func = nil, headers=nil, &b)
func = "main" if !func or func.empty?
lib = with_config(lib+'lib', lib)
checking_for "#{func}() in #{LIBARG%lib}" do
@@ -563,7 +576,7 @@
true
else
libs = append_library($libs, lib)
- if try_func(func, libs, header, &b)
+ if try_func(func, libs, headers, &b)
$libs = libs
true
else
@@ -573,6 +586,13 @@
end
end
+# Returns whether or not the entry point +func+ can be found within the library
+# +lib+ in one of the +paths+ specified, where +paths+ is an array of strings.
+# If +func+ is nil , then the main() function is used as the entry point.
+#
+# If +lib+ is found, then the path it was found on is added to the list of
+# library paths searched and linked against.
+#
def find_library(lib, func, *paths, &b)
func = "main" if !func or func.empty?
lib = with_config(lib+'lib', lib)
@@ -595,6 +615,14 @@
end
end
+# Returns whether or not the function +func+ can be found in the common
+# header files, or within any +headers+ that you provide. If found, a
+# macro is passed as a preprocessor constant to the compiler using the
+# function name, in uppercase, prepended with 'HAVE_'.
+#
+# For example, if have_func('foo') returned true, then the HAVE_FOO
+# preprocessor macro would be passed to the compiler.
+#
def have_func(func, headers = nil, &b)
checking_for "#{func}()" do
if try_func(func, $libs, headers, &b)
@@ -606,6 +634,14 @@
end
end
+# Returns whether or not the variable +var+ can be found in the common
+# header files, or within any +headers+ that you provide. If found, a
+# macro is passed as a preprocessor constant to the compiler using the
+# variable name, in uppercase, prepended with 'HAVE_'.
+#
+# For example, if have_var('foo') returned true, then the HAVE_FOO
+# preprocessor macro would be passed to the compiler.
+#
def have_var(var, headers = nil, &b)
checking_for "#{var}" do
if try_var(var, headers, &b)
@@ -617,6 +653,13 @@
end
end
+# Returns whether or not the given +header+ file can be found on your system.
+# If found, a macro is passed as a preprocessor constant to the compiler using
+# the header file name, in uppercase, prepended with 'HAVE_'.
+#
+# For example, if have_header('foo.h') returned true, then the HAVE_FOO_H
+# preprocessor macro would be passed to the compiler.
+#
def have_header(header, &b)
checking_for header do
if try_cpp(cpp_include(header), &b)
@@ -628,6 +671,12 @@
end
end
+# Instructs mkmf to search for the given +header+ in any of the +paths+
+# provided, and returns whether or not it was found in those paths.
+#
+# If the header is found then the path it was found on is added to the list
+# of included directories that are sent to the compiler (via the -I switch).
+#
def find_header(header, *paths)
checking_for header do
if try_cpp(cpp_include(header))
@@ -647,11 +696,22 @@
end
end
-def have_struct_member(type, member, header = nil, &b)
+# Returns whether or not the struct of type +type+ contains +member+. If
+# it does not, or the struct type can't be found, then false is returned. You
+# may optionally specify additional +headers+ in which to look for the struct
+# (in addition to the common header files).
+#
+# If found, a macro is passed as a preprocessor constant to the compiler using
+# the member name, in uppercase, prepended with 'HAVE_ST_'.
+#
+# For example, if have_struct_member('foo', 'bar') returned true, then the
+# HAVE_ST_BAR preprocessor macro would be passed to the compiler.
+#
+def have_struct_member(type, member, headers = nil, &b)
checking_for "#{type}.#{member}" do
if try_compile(<<"SRC", &b)
#{COMMON_HEADERS}
-#{cpp_include(header)}
+#{cpp_include(headers)}
/*top*/
int main() { return 0; }
int s = (char *)&((#{type}*)0)->#{member} - (char *)0;
@@ -664,17 +724,30 @@
end
end
-def have_type(type, header = nil, opt = "", &b)
+# Returns whether or not the static type +type+ is defined. You may
+# optionally pass additional +headers+ to check against in addition to the
+# common header files.
+#
+# You may also pass additional flags to +opt+ which are then passed along to
+# the compiler.
+#
+# If found, a macro is passed as a preprocessor constant to the compiler using
+# the type name, in uppercase, prepended with 'HAVE_TYPE_'.
+#
+# For example, if have_type('foo') returned true, then the HAVE_TYPE_FOO
+# preprocessor macro would be passed to the compiler.
+#
+def have_type(type, headers = nil, opt = "", &b)
checking_for type do
- header = cpp_include(header)
+ headers = cpp_include(headers)
if try_compile(<<"SRC", opt, &b) or (/\A\w+\z/n =~ type && try_compile(<<"SRC", opt, &b))
#{COMMON_HEADERS}
-#{header}
+#{headers}
/*top*/
static #{type} t;
SRC
#{COMMON_HEADERS}
-#{header}
+#{headers}
/*top*/
static #{type} *t;
SRC
@@ -686,13 +759,23 @@
end
end
-def check_sizeof(type, header = nil, &b)
+# Returns the size of the given +type+. You may optionally specify additional
+# +headers+ to search in for the +type+.
+#
+# If found, a macro is passed as a preprocessor constant to the compiler using
+# the type name, in uppercase, prepended with 'SIZEOF_', followed by the type
+# name, followed by '=X' where 'X' is the actual size.
+#
+# For example, if check_sizeof('mystruct') returned 12, then the
+# SIZEOF_MYSTRUCT=12 preprocessor macro would be passed to the compiler.
+#
+def check_sizeof(type, headers = nil, &b)
expr = "sizeof(#{type})"
m = "checking size of #{type}... "
message "%s", m
a = size = nil
Logging::postpone do
- if size = try_constant(expr, header, &b)
+ if size = try_constant(expr, headers, &b)
$defs.push(format("-DSIZEOF_%s=%d", type.upcase.tr_s("^A-Z0-9_", "_"), size))
a = "#{size}\n"
else
@@ -847,6 +930,17 @@
$extconf_h = header
end
+# Sets a +target+ name that the user can then use to configure various 'with'
+# options with on the command line by using that name. For example, if the
+# target is set to "foo", then the user could use the --with-foo-dir command
+# line option.
+#
+# You may pass along additional 'include' or 'lib' defaults via the +idefault+
+# and +ldefault+ parameters, respectively.
+#
+# Note that dir_config only adds to the list of places to search for libraries
+# and include files. It does not link the libraries into your application.
+#
def dir_config(target, idefault=nil, ldefault=nil)
if dir = with_config(target + "-dir", (idefault unless ldefault))
defaults = Array === dir ? dir : dir.split(File::PATH_SEPARATOR)
@@ -1021,6 +1115,24 @@
RULES
end
+# Generates the Makefile for your extension, passing along any options and
+# preprocessor constants that you may have generated through other methods.
+#
+# The +target+ name should correspond the name of the global function name
+# defined within your C extension, minus the 'Init_'. For example, if your
+# C extension is defined as 'Init_foo', then your target would simply be 'foo'.
+#
+# If any '/' characters are present in the target name, only the last name
+# is interpreted as the target name, and the rest are considered toplevel
+# directory names, and the generated Makefile will be altered accordingly to
+# follow that directory structure.
+#
+# For example, if you pass 'test/foo' as a target name, your extension will
+# be installed under the 'test' directory. This means that in order to
+# load the file within a Ruby program later, that directory structure will
+# have to be followed, e.g. "require 'test/foo'".
+#
+#
def create_makefile(target, srcprefix = nil)
$target = target
libpath = $LIBPATH